Here several libraries/framework that I find can form a good combination for small to medium project :
- Slim is a micro framework for PHP. It is a good enough to help separate the web application into a more modular, decoupled architecture (call it something like MVC if you like). It's a very low-cost approach compare to using full-blown framework like Zend. In Python, I used Flask and it's quite similar.
- Twig is a templating Engine. It's like Jinja in Python. In fact, the initial coder is Jinja developer, so it's not too strange that it feels quite similar. I don't think people should write/generate HTML code inside PHP directly anymore. It's inhumane :). Templating engine helps the code deal with the logic exclusively while it deals with how to present it. It has a good two-ray integration with Slim above : there's Slim extension for Twig and Twig can be plug to Slim as Template engine.
- Idiorm/Paris is a a very light ORM layer for PHP. It just one class and one file with a straightforward and simple uses yet it does the job really well.
And how the architecture looked like?
ReplyDeleteHi Daniel,
ReplyDeleteThere's not much an "architecture" really since the three of them are quite light wieght.
The core of the architecture is Slim. Inside Slim, the data-related tasks are done using Idiorm/Paris and the rendering of the page is done using Twig through the extension.
Basically :
Idiorm/Paris <- Slim -> Twig
When it comes to design google in PHP, many individuals will tell that PHP itself is a design engine. But even if PHP began its lifestyle as a design terminology, it did not progress like one in the the past few decades.
ReplyDelete