Exploring Microframeworks

I have been recently playing with the microframeworks, Silex and Slim, the full stack framework, CakePHP and the relatively cool framework that is Yii for several projects. I admit that exploring these frameworks, especially Silex and Slim, have been awesome experiences and I intend to learn these frameworks to grow my skills.

My frameworks of choice have always been either Kohana which I have worked since version 2.3.4 to 3.0 and CodeIgniter from versions 1.6.1 to 2.1.3. I have used CakePHP and Yii for some projects but I never really grasped the ideas behind CakePHP until I now. Yii, just like CakePHP is a full stack framework but is much easier to learn than CakePHP. This is probably is the real reason(not because CakePHP is slow) why Yii is being advocated by a lot of PHP developers today.


Silex is a microframework that I have reading and learning about in the last few days. My first impression was that Silex is nothing more than a routing framework and glue framework. With Silex you will decide how to structure your application. While you may find some Silex applications with the same structure, there will be just be a few as compared to applications built with CakePHP, CodeIgniter, Yii and the others which enforces / favors structure and convention.


Along with Silex, I have been using Slim, a micro framework developed by Josh Lockhart. So far, I have been liking this better than Silex. The two microframeworks have almost the same concepts. The following reason are why I like Slim better:

Silex also doesn't have a way to render php files out of the box. You would need to create your Output Control implementation to do this or use Twig, which is very much supported by Silex. In my case, I like flexibility. I need not learn another templating engine to use Slim. With Slim, you can use Twig or any templating engine you want but also use plain old PHP files as view files.

Silex makes heavy use of Symfony Components. Silex could get complex pretty quickly.

Take note that Silex's heavy use of Symfony components is not a bad thing. With Silex, you won't be scouring the internet for how to integrate Twig, Swiftmailer, Form Validation and many others. Symfony components can easily be integrated to Symfony which makes it a more `complete` framework than Slim.

As I finish typing, I just deployed the Slim framework version of my application.