I have seen a number of websites lately still using query string URLs (http://www.mysite.com/index.php?id=1) for general content pages. I do not object to using these for special cases like a complex search, product filtering and other cases which I can't think of at the time of writing this.
Slim Framework has been around for some time now and it has become my de-facto micro framework for developing small projects or even just prototyping concepts easily. I have been long looking for a good package manager for PHP that would allow me to easily load any package I want to use in my projects.
In this post I will continue from my last post about Using PHPActiveRecord with Slim Framework we will move on to creating template(views) using Twig Template Engine. Twig is written by the creator of Symfony Framework Fabien Potencier and the template syntax is easy to understand and extending Twig is also relatively easy. Before continuing any further I would advice on following the previous blog post Using PHPActiveRecord with Slim Framework or if you are not interested in learning about PHPActiveRecord you can download the files from the GitHub repository.
When prototyping projects in PHP I normally use Slim Framework and for all database interactions I use PHPActiveRecord. These tools make Rapid Application Prototyping quick and easy to manage. In this article I will go through step by step explaining how to get these two up and running.