When comparing CakePHP vs Silex, the Slant community recommends CakePHP for most people. In the question“What are the best PHP frameworks?” CakePHP is ranked 11th while Silex is ranked 14th. The most important reason people chose CakePHP is:
Cake has a built-in ORM which is pretty easy to use and learn. Building queries can also be done very easily and fetching entire columns can be done in one or two lines of code.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Built-in ORM that's easy to use
Cake has a built-in ORM which is pretty easy to use and learn. Building queries can also be done very easily and fetching entire columns can be done in one or two lines of code.
Pro Fast development
Developing in CakePHP is very fast and flexible.
CakePHP is about fast and reliable development, it achieves this by following the convention over configuration principle as it's heavily inspired by Rails (which follows the same programming paradigm).
Convention over configuration is all about making it easier for the developer to start immediately writing code without worrying on what's going on "under the hood".
Pro Large library of helper classes
CakePHP has a large library of helper classes with features such as:
- Authorization
- AJAX
- Forms
- E-mails
- Internationalization
etc...
Pro Exhaustive list of resources to learn CakePHP
Cake's great community has thrown together an exhaustive and amazing list of resources to get started with CakePHP. It's open source and can be found on GitHub.
Pro Open Source
CakePHP open source and is licensed under the MIT license.
Pro Built on top of Symfony components
The thing that makes Silex stand out from other PHP microframeworks is the fact that it's built using some of Symfony2's components. Making it quite powerful but still lightweight enough to be considered a true microframework.
Pro Open source
Silex is open source and is licensed under the MIT license.
Pro Simple and elegant DI container
Based on Pimple, Silex has a simple Dependency Injection container that consists of just one file and one class.
Pro Testable
Silex makes use of Symfony2's HttpKernel which is used to abstract requests and responses. This in turn, makes it very easy to test apps created with the framework.
Pro Extensible
By using Pimple, the Silex application extends the Pimple class, which in turn is nothing more than an implementation of the ArrayAccess interface that has been a part of PHP since version 5.0.
This makes it possible to use an instance of the Application class as if it were an array. Like so:
$app = new Silex\Application();
$app['config'] = new Config($config_path);
This gives developers a great deal of flexibility when injecting dependencies and when testing.
Cons
Con Slow
Because of legacy code, old concepts and prioritizing development speed over everything else, CakePHP is bloated and slow.
Con Documentation is not very extensive
The documentation for this framework is average, it's helpful mostly. But it is not extensive enough to cover everything in detail unfortunately.