Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Yii2 or Laravel5 compensate the weakness points in Codeigniter?

I am a Web developer, I use Codeigniter from 3 years, and I used it in many production projects, also Codeigniter was my start point with developing projects based on framework. Later, I noticed that other php frameworks provides many useful features that make developer life easier such as:

  • Database migration which making altering database schema easier and more efficient
  • Code generation (scaffolding): which generate model, view, and controller for the entity
  • Form validation: form validation rules is determined in generation and framework do the rest
  • REST API: Support REST Controller natively in framework without third party plugin

All these reasons make me thinking to switch to other framework.

After searching, I found Laravel5 have features that I need, also It has a big community of developers.

My friend use Yii2 and he recommend me to switch to Yii2, also I found statistics both Laravel and Yii has good reputation in these statistics.

How Laravel5 and Yii2 Differ from other and which added value for each framework

like image 498
Alaa M. Tekleh Avatar asked Jul 08 '16 12:07

Alaa M. Tekleh


3 Answers

I can only give you the experience we here at Sourcetoad have had:

1) Production ready: Yii2 follows semver (like the rest of the PHP community/eco-system), when the framework is patched the changes are predictable and well advertised ahead of time.

2) Learning curve: Laravel wins out here; many more tutorials, cookbooks, web resources, and personnel.

3) Security: From our experience Yii/2 goes above and beyond. Not just configurable, not optional, nearly every standard security practice is active by default.

4) As you pointed out scaffolding: Yii/2 wins out here. From Gii onward scaffolding generation is a breeze.

5) Community: While we here have not needed to overly engage the community around each framework they are both part of the OSS community; however our initial impression is the Laravel might/maybe nudge ahead here. No conclusive examples to go on.

In the end the answer is: right tool, right job.

like image 91
David J Eddy Avatar answered Oct 28 '22 17:10

David J Eddy


Introduction

I've been a senior full stack developer for +3 years and mainly i use Yii for php development But i was told that laravel is better so i decided to build an eCommerce Script with laravel to get to know laravel more and to see the difference between Yii and laravel.

So finally what the difference between laravel and Yii?

in a few words mainly Nothing , But Yii has a better way to deal with forms.

details

  1. easiness to learn: if you're an experienced developer it will take about an hour to learn each one of the frameworks. and both of the frameworks has an helpful documentation.

  2. dealing with rest api:both of them make producing REST APIs easy and both has its own way. but i use Laravel when developing rest api cause laravel more helpful when developing using microservices architecture.

  3. developers community it might seem that laravel has a larger community of developers but during my career with Yii i've found no bottleneck of having a question without an answer.

  4. jobs Chances You'll get a better chance to find a job if you're an experienced laravel developer rather than Yii.

finally:

it's up to you what to choose cause both of frameworks is powerful and helpful

like image 41
Mohammed Manssour Avatar answered Oct 28 '22 18:10

Mohammed Manssour


Yes!, Laravel5 or Yii2 has built-in features that Codeigniter lacks.

For me I've been using laravel for about 5 months, it has some strong features like ORM (Eloquent), DB Migration, Form validation, REST API, HTTP Middlewares, and scaffolding (using a third-party).

I've never used Yii before, so I can't tell differences between the two, but also it sounds that it has some good features, But it is said that developers go through four stages:

  1. No framework
  2. Use a framework.
  3. Write own framework.
  4. No framework.

An interesting article to read about this link.

These days all you need to do is grab a bunch of components that work together (relying on each other, or working despite each other), bootstrap them altogether, set up some routing, hook up a config system, lay your controllers out, handle session configuration and connect to your database.

You can do that completely with random pick-and-mixed Composer components. But when you've done writing that application layer… guess what you've done?

You've just written a framework.

Sturgeon, L. (n.d.). The "Framework" is Dead, Long live the Framework. Retrieved July 11, 2016, from https://philsturgeon.uk/php/2014/01/13/the-framework-is-dead-long-live-the-framework/

Finally, there's no perfect answer for your question, everyone is using his favorite option, some prefer using a framework, some prefer to go custom. You just stick to what you feel comfortable with, and always try to find better ones.

like image 4
Hady Hallak Avatar answered Oct 28 '22 16:10

Hady Hallak