Difference between revisions of "PHP115"

From mi-linux
Jump to navigationJump to search
Line 5: Line 5:
 
= Template engines =
 
= Template engines =
  
There are many PHP template engines out there, some of the most popular ones are:
+
There are many PHP template engines out there, there are some of the most popular ones:
 
* [http://twig.sensiolabs.org/ Twig] - probably the best current, framework-independent template engine.
 
* [http://twig.sensiolabs.org/ Twig] - probably the best current, framework-independent template engine.
 
* [https://mustache.github.io/ Mustache] - also very popular, much very simple and so not suitable for more complex projects.
 
* [https://mustache.github.io/ Mustache] - also very popular, much very simple and so not suitable for more complex projects.

Revision as of 09:02, 30 June 2016

Main Page >> Web Application Development >> Workbook >> Template Engines

Please note that this is an advanced topic. Make sure that you have worked through all the previous sections of this workbook before proceeding.

Template engines

There are many PHP template engines out there, there are some of the most popular ones:

  • Twig - probably the best current, framework-independent template engine.
  • Mustache - also very popular, much very simple and so not suitable for more complex projects.
  • Smarty - very old, and the website looks very date, but the product itself is very good and still actively maintained!
  • Blade - Blade comes with Laravel, a very popular PHP framework, but cannot easily be used without Laravel.
  • Volt - Volt is packaged with the Phalcon PHP framework, but can be used as a standalone product.

In this tutorial we will look at Twig

Installing Twig