On 9/22/10 4:15 AM, Yuen-Chi Lian wrote:
I suppose Twig is not bundled with SF2 - therefore it's a thirdparty from SF's point of view.
No, it's not. Everything can be bundle with Symfony2 (and this is actually the case right now.)
From beginner's point of view, it can be a blow to them to learn another thing extra - especially if they're at the struggling stage of setting up SF2, the extra care on how Twig shall be setup properly.. if we can avoid them such problem, we shall do it.
If we decide to use Twig by default, nothing will need to be setup or configured.
Fabien
Yuen-Chi Lian | www.yclian.com <http://www.yclian.com> "I do not seek; I find." - Pablo Picasso On Wed, Sep 22, 2010 at 5:04 AM, Jordi Boggiano <j.boggi...@seld.be <mailto:j.boggi...@seld.be>> wrote: Heya, I would like to start a discussion on whether we should adopt Twig as the *default* Renderer for Symfony2 instead of PHP templates. My view of it is this: - PHP templates are a great default since PHP is obviously always there, but Twig seems to have become a first class citizen already, so it wouldn't be too problematic, and it can always be removed if someone doesn't like it. - In my experience PHP templates encourage not-so-MVC-conscious developers to put too much logic in their views, because it's very easy to do so. Twig provides a context switch that help people make a distinction, and also makes it harder/impossible to code complex logic in templates. - Twig with the custom tokens provides much more fluent and clean interfaces to the template helpers, not to mention shorter. e.g.: > {% route 'blog_post' with ['id': post.id <http://post.id>] %} > > <?php echo $view['router']->generate('blog_post', array('id' => $post->id)) ?> - The Twig syntax with dots to access properties and all looks and feels like javascript, which imo is great for frontend developers to be sort of in the same environment no matter if they work in templates or in js code. - On the downside, I guess Twig has a bit of a learning curve, but then again people must learn the symfony "keywords" anyways, like $view['router'], that aren't especially obvious to a non-sf developer. So it's not like PHP templates are completely straightforward, and Twig syntax is quite simple and well documented. Thoughts? Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com <http://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 symfony-devs@googlegroups.com <mailto:symfony-devs@googlegroups.com> To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com <mailto:symfony-devs%2bunsubscr...@googlegroups.com> 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 symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com 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 symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en