Diving deep into Twig

Matthias Noback (21.Feb.2013 at 19:30)
Talk at AmsterdamPHP February Meeting (English - US)

Rating: 4 of 5

Developers are able to modify the behavior and possibilities of Twig (the PHP templating engine by Fabien Potencier) in many ways, ranging from very easy to very tough. It all starts with simply registering your extension, but from then on you can choose to create your own filters, functions and tests. I will quickly review your options, and show some best practices. After discussing these basic modifications, we'll take a look at creating token parsers and thinking up custom node types, which will enable you to define your own tags (the things between {% %}). I will demonstrate the inner workings of Twig: from the loader, to the lexer, to the parser, to your own token parser, to creating nodes, filtering nodes using a node visitor and finally to the compiler, which transforms all nodes to plain old PHP.

Who are you?

Claim talk

By clicking this button you are declaring that you are the speaker responsible for it and a claim request will be sent to the administrator of the event.

If the claim is approved you will be able to edit the information for this talk.

Are you sure?

Comments closed.


Rating: 4 of 5

22.Feb.2013 at 09:44 by Marc Ypes (18 comments)

Good talk and speaker, very technical talk about twig internals. I appreciate seeing some good in-depth talks on amsterdamphp.

Rating: 3 of 5

22.Feb.2013 at 12:04 by Nick Spelt (1 comments)

Very technical for somebody who has yet to do anything with twig it.
In my mind reversing the talk would make it easier to understand for newcomers.
Start with what you can do with Twig, show some cool examples and then dive into how it does what it does.

Overall good talk, gave me some good ideas about how i could implement Twig

Rating: 4 of 5

22.Feb.2013 at 13:57 by Frank van den Brink (40 comments)

Very interesting subject. Gave me quite some new insights into Twig.

Too bad the images didn't show. For a first time I thought you did great. As you do the talk more and more it'll get easier and you'll be more comfortable :)

Keep it up!

© Joind.in 2015