×
  • Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 

Being Dangerous with Twig (Symfony Live Paris)

by Symfony Developer at KnpLabs on Mar 04, 2011

  • 13,852 views

Twig - the PHP templating engine - is easy to use, friendly and extensible. This presentation will introduce you to Twig and show you how to extend it to your bidding.

Twig - the PHP templating engine - is easy to use, friendly and extensible. This presentation will introduce you to Twig and show you how to extend it to your bidding.

Statistics

Views

Total Views
13,852
Views on SlideShare
10,796
Embed Views
3,056

Actions

Likes
29
Downloads
218
Comments
2

24 Embeds 3,056

http://www.lafermeduweb.net 2378
http://francescoagati.wordpress.com 213
http://www.symfony.es 148
http://blogdwich.fr 129
http://pocky.github.com 64
http://www.ccplz.net 49
http://www.emmanuelpereira.com 12
http://metaphp.wordpress.com 10
http://coderwall.com 10
http://pocky.github.io 8
http://www.sfexception.com 7
http://webcache.googleusercontent.com 5
http://translate.googleusercontent.com 4
url_unknown 3
http://wesley.dev.freshheads.com 3
http://static.slidesharecdn.com 2
http://wesley.dev.freshheads.local 2
http://www.linkedin.com 2
http://symfony.es 2
http://ccplz.net 1
http://joostf.dev.freshheads.local 1
http://m.lafermeduweb.net 1
http://symfony2developer.com 1
http://dev.symfony2developer.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

CC Attribution-NonCommercial LicenseCC Attribution-NonCommercial License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • weaverryan Ryan Weaver, Symfony Developer at KnpLabs Hi Mykhailo!

    Yes, you're absolutely right! PHP templates definitely can do everything that Twig templates can do - it's a matter of choice and taste. Each does things a little bit different, but both are good choices.

    Also, I don't think developers are stupid - that's a pretty unfair statement :/ I really like Twig, but if you don't like it, that's totally fine :).

    Also, you *can* choose between Twig or normal PHP templates in Symfony, and all examples in the Symfony docs show both. I think there are two places where Twig is used internally by the framework (which I think is what you're referring to as the hard linking):

    1. The web debug toolbar & profiler - a debugging tool used locally

    2. Exception & error templates. This can be overridden by replacing the ExceptionController (http://symfony.com/doc/2.0/reference/configuration/twig.html#config-twig-exception-controller) and rendering a PHP template instead.

    I hope that helps! These tools are meant to make life simpler :)
    2 years ago
    Are you sure you want to
    Your message goes here
    Processing…
  • mykhailostadnyk Mykhailo Stadnyk, Project Manager at GlobalLogic Any templating system written with a template language like PHP is evil. All you describing here is a fake. You are trying to concern is that all the developers are idiots, so you have to restrict them with something named Twig and telling them that 'you are as stupid as not allowed to use PHP inside templates, Twig is better for you'. I see no reason of doing something like:

    {% blablabla %}

    instead of



    Really NO MATTER! But the last one is a pure PHP code, no matter how it is implemented inside your framework - using of handling output buffering or not (yes, yes, it is possible to do without).

    Please, let user to choose what is better - to twig or not to twig. That's what I don't like in Symfony. I don't want my framework take decision. I want to choose which templating system to use. I like PHP, someone like Twig, someone wants to have Smarty (is it alive yet?)

    For the moment a have a big problem - I want to remove completely twig from a Symfony project and can not do it - because of hard linking of a framework and twig templating system. It's a nightmare...
    2 years ago
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Being Dangerous with Twig (Symfony Live Paris) Being Dangerous with Twig (Symfony Live Paris) Presentation Transcript