Slim vs Yii: What are the differences?
Slim: A PHP micro framework. Slim is easy to use for both beginners and professionals. Slim favors cleanliness over terseness and common cases over edge cases. Its interface is simple, intuitive, and extensively documented — both online and in the code itself; Yii: A high-performance PHP framework best for developing Web 2.0 applications. Yii comes with: MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, etc. It can reduce your development time significantly.
Slim belongs to "Microframeworks (Backend)" category of the tech stack, while Yii can be primarily classified under "Frameworks (Full Stack)".
"Microframework" is the primary reason why developers consider Slim over the competitors, whereas "Open source" was stated as the key factor in picking Yii.
Slim and Yii are both open source tools. It seems that Slim with 9.92K GitHub stars and 1.84K forks on GitHub has more adoption than Yii with 4.87K GitHub stars and 2.21K GitHub forks.
According to the StackShare community, Yii has a broader approval, being mentioned in 48 company stacks & 29 developers stacks; compared to Slim, which is listed in 26 company stacks and 19 developer stacks.
What is Slim?
What is Yii?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Slim?
What are the cons of using Yii?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
I'm about to start a new project to build a REST API, and I got to this point: Yii2 Vs Lumen Vs Slim, I used Yii 1.1 a while a go and it was awesome, really easy to work with, as a developer you don't have to worry about almost anything, just setup the framework, get your php extensions, and start coding your app.
But, I was told about performance and someone recomended Lumen or Slim to work with a micro framework and a less bloated framework, what worries me is the lack of advantages that Yii2 offers, ACF and RBAC as a native tool on the framework, gii, the model validations and all the security props already in it.
Is it worth it? Is the performance so great on those frameworks to leave aside the advantages of a framework like Yii2?
How do you suggest to make the test to prove wich one is better?
PHP Lumen Yii Slim
Of all PHP frameworks, my best and only choice is Yii . Think of this: you have a MySQL database, it contains several tables. Now you want to setup a PHP-MVC site, firstly, you must create Models, Yii have a very handy tool called Gii, you can easily create model with Gii just by one click, Gii will read your database table columns and create PHP models automatically for you. Now you need Controller, still with Gii, it will automatically create all 4 php files for you with Insert/Delete/Update/Select even with Search function.
Well, now the most modern way is to have a RESTful API, that's even easier with Yii, you even don't need to care about all the columns, just 4 lines of code you can expose your database table as RESTful API with all GET/POST/PUT/DELETE support, even you change your database table columns, you don't need to change any PHP code.
For security, Yii have embedded authentication and RBAC support. For multi language, Yii have embedded i18n support, all with out-of-box. Just play with it, I bet you will love it.