A Look at Silex: A Symfony2-based PHP Microframework
The Web Dev Zone is brought to you in partnership with Mendix. Discover how IT departments looking for ways to keep up with demand for business apps has caused a new breed of developers to surface - the Rapid Application Developer.
Contrary to most other microframeworks, however, Silex is built on top of an existing open source project: Symfony2. A microframework is a very small framework which basically does nothing more than bootstrap and handle your request and response. Though the microframeworks cater to a very specific need, I really like the approach of not needing a full framework for a project that clearly is simple enough not to need one.
Some things I really like about Silex are:
- Built on top of existing open source components
- Packaged in a phar package
- Extensible: There are extensions available to the Silex core, and I can extend it even more
Using Silex, Stefan found a lightweight approach to getting his simple application up and running in a couple of hours by just coding and improving in small steps.
What I've found is that Silex (or any other microframework for that matter) is an excellent approach for small projects where you start with an idea of what you want to build and then improve on your existing code. It is very tempting to put in hackish solutions, which is OK if you keep on improving --Stefan Koopmanschap
Stefan says that microframeworks are also useful for application prototyping. Their simplicity helps you prototype very quickly.