Giter VIP home page Giter VIP logo

Comments (5)

uwetews avatar uwetews commented on July 18, 2024

Closure support is new added in the dev-master version.
It will be included in 3.1.28

Read also NEW_FEATURES.txt

from smarty.

ildar-aim avatar ildar-aim commented on July 18, 2024

Thank you.

from smarty.

ildar-aim avatar ildar-aim commented on July 18, 2024

May be an issue with two or more closure's filters.

1)first call to registerFilter returns
registered_filters[$type]['closure'] = closure_obj1

2)second call to registerFilter overwrites the first filter
registered_filters[$type]['closure'] = closure_obj2

The problem code is not uniq index in the _getFilterName function

return 'closure';

from smarty.

ildar-aim avatar ildar-aim commented on July 18, 2024

Should I open a new ticket related to non-unique filter names ?

from smarty.

uwetews avatar uwetews commented on July 18, 2024

I updated NEW_FEATURES.txt to make it more clear.

If you register multiple closures use the new filter name parameter to assign unique filter names.

$smarty->registerFilter('pre', function($content) {return $content;}, 'name1');
$smarty->registerFilter('pre', function($content) {return $content;}, 'name2');

from smarty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.