Today, I would like to show one of the new features in Open Power Template useful for all the CMS and framework developers. They are so-called ”inflectors” whose task is locating templates on the hard disk. So far, the mechanism has been hard-coded in the public API structure, but now we can change it thanks to new interface. Our implementation can be freely customized, so that it matches our needs.
In the second part of November, the new beta releases of Smarty 3, the successor of Smarty template engine were flooding in surprisingly fast. As I have had some spare time, I have decided to take a closer look and review it to see, if the authors learned something during the last few years, because one has to be said: Smarty 2 was one of worse template engines available.
In this post I would like to show some useful tricks for the programmers using Open Power Template library, a template engine for PHP5. The library provides many powerful generic tools that make writing templates much easier than in pure PHP, but it may be not so obvious, how to use them i.e. to create a nice pagination.
Have you ever wondered why the web application scripts are written in such languages as PHP instead of C and C++? Or why we are not programming in Pascal? The popularity of “web” languages comes from satisfying the programmers’ needs and innovations, thus letting to create the websites faster and cheaper. However, in this post I will not discuss the officially recognized languages. Instead, I am going to analyze the template engines, a part of web applications concerning on producing the HTML output which has a lot in common with programming language issue.
A couple of days ago Fabien Potencier, the lead developer of Symfony framework, published on his blog two notes about template engines that introduced Twig template engine. They contain a benchmark, where the author claims that Twig is the fastest and least memory-consuming template engine. For the first time I saw I even believed it… until I looked at the test procedure. This led me to write a note why we should check benchmarks twice before we believe them and what tricks can be used to prove absolutely everything.