On 1/5/11 1:58 AM, Thomas Rabaix wrote:
Fabien,
I just update my symfony repository, and the HelperTokenParser is not
available anymore [1].
Just by reading the diff code [2] HelperTokenParser was really a friend
of us !
Can you tell us why this change ? (performance ?)
It has nothing to do with performance (even if of course there is a
performance penalty -- but a small one).
The "Grammar" feature in Twig and the associated SimpleTokenParser class
have been removed from Twig core (as I'm not yet satisfied with the
syntax yet and Twig 1.0 will soon enter its release cycle). So, as the
feature won't be in 1.0, it has been moved to the Twig-Extensions
repository. It means that you can still use it if you want.
When I introduced the grammar notation for tags some time ago, it was to
help people create tags easier. At that time, the creation of tags was
the only to extends Twig for certain things. But now that Twig supports
functions, I think that the need for new tags is pretty rare. Most of
the time, you'd better create a function instead. Tags are for language
construct, and extending the language is not something you do often. So,
instead of keeping an experimental feature in the core for the rare
occasion where you need to create a tag, I have removed it from the
core, but again, it's still available in Twig-Extensions if you want.
Twig has many extension points. If you want to learn more about when to
use one or the other, you can read this chapter of the Twig documentation:
http://www.twig-project.org/doc/advanced.html
Have a look at the table just before the "Globals" section for a quick
summary of the different extension points and when to use them.
Fabien
[1]
https://github.com/fabpot/symfony/commit/2e9b8a4117733a3609262208faedb617f9b589ef
[2]
https://github.com/fabpot/symfony/commit/840bd8aacd4ab48474e0600ecd54acee7b82f080
--
If you want to report a vulnerability issue on symfony, please send it
to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en