News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

ServerGrove Blog:
Symfony2 components overview Templating
March 14, 2014 @ 10:11:46

The folks at ServerGrove have posted the latest in their series focusing in on various components of the Symfony2 framework. This time they look at the Templating component, useful for working with the output from the application, web or otherwise.

The Templating component provides an engine-agnostic infrastructure to load template files and render them using the input variables. Although the component provides methods for creating template systems, we are going to focus on how to integrate third-party template engines like Twig and Smarty, and how to use the right engine based on the templates file extension.

The post talks about typical PHP output (with escaping) and shows the difference between a call with htmlspecialchars and the use of the Template component to render a view. An example is also included showing the use of other template engines into the template object, plugged directly into the "render" method. The end of the post also briefly mentions an alternative template language, Plates, an option similar to Twig but uses native PHP rather than tags and placeholders.

0 comments voice your opinion now!
symfony2 component overview templating tutorial

Link: http://blog.servergrove.com/2014/03/11/symfony2-components-overview-templating/

blog comments powered by Disqus

Similar Posts

PHPEverywhere: Simple Easy Parallel Processing in PHP

DevShed: Generating Web Pages in Multiple Languages with a PHP IP-to-Country Mapping Application

MaltBlue.com: Zend Form Mastery with Zend_Config - Part 3, Standard Form & Element Options

PHPMaster.com: Using Facebook’s Realtime Updates and Subscription API

Sameer Borate's Blog: Splitting large MySQL dump files


Community Events





Don't see your event here?
Let us know!


list threedevsandamaybe community interview series wordpress release code language library introduction podcast unittest testing api laravel configure install developer application

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework