How Does The Yii Deal With The Challenges From Laravel?


If you guys have the time could you provide a simple comparison with Lavavel? I know it might be nonsense to keep comparing the technologies. But you know sometimes people do get such bored.[/font][/size]

[size="4"][font="Arial"]Yii2 is still require some more time to perfect. I am really excited to see how could it continue its own legend. Since we have been seeing that Yii2 is updating almost everyday on GitHub for quite a long time,I am wondering is it the right time to release more information. The most important question i guess when we could actually use it for developing.[/font][/size]

I’ve worked with laravel 4 a little. My opinion: you should go with Yii2.

Here are some details:

  1. Laravel community is dead.

Ya rly. They can answer to simple questions but keep silent when it comes to advanced framework usage.

  1. As for me, core code is much harder to understand.

IoC container, facades and so on. Dude, where’s my car code?

Using Yii2 I can write code not even looking at the docs, because its core is simple and clean for me.

  1. Validation in controller? Seriously?..

Of course, there’s a way to move this to a model (via validation services), but you’ll need to google for that.

  1. (not so bad, but personally I dislike it)

Their PRG pattern in case of validation failure looks like this:

return Redirect::to('form')->withInput()->withErrors();

All the form data and validation errors are passed through session.

  1. Their coding style is crap.





(that’s a line from docs)

Every time you forgot a space between "if" and "(" god kills a kitten, you know.

And there should not be a new line!

  1. Yes, there are some good and/or interesting stuff in Laravel like “soft delete”, queues and polymorphic relations (I wonder if someone’s actually using it), but it seems to me that I’ve had to write A LOT more code if I use Laravel than if I use Yii2.

You should start right now :)

If you have questions like “can/how I do this in Yii2”, feel free to post them here, I’ll try to answer.

Your answer is *** humorous! LOL

From your last elaborate post, you have answered most of the questions. However, I am still a little bit worried about YII2 for commercial use. They said it is just for preview only. Qiang and his team commit almost everyday in recent days. I guess they are still preparing an even more powerful and more functional version. Therefore I guess the final version may seem quite different from what we see so far.

I think I may continue to use Yii 1.1.14 + bootstrap 2.3.2

Everything is at github. Nothing’s done secretly now. Of course, for short term commercial projects with tight deadlines it’s preferrable to use stable 1.1 that will be supported for a long time. 2.0 final may be different from what’s there now but no huge changes are planned. Polishing, bugfixing, more components, a bit of re-structuring that’s mostly done (gii and debugger moved to separate packages).

Well, obviously the yii devs can’t advise you to use their new not-even-alpha software, when there is a stable version out there. I personally haven’t tried a lot, but making a new CRUD-application and tried a Grid View and it looks fine. I guess most of the basic stuff already works fine. Take a look at the Roadmap:

Yea, documentation isn’t perfect which isn’t that great, but there’s always a little documentation, there are inline comments and at last there is the code itself.

I am, for a new project, am also considering Yii2 and Laravel 4. Although, if I haven’t decided yet, I tried to read up about Laravel and I can say it helped me a lot understanding understanding the concepts of a framework, that I didn’t when I used Yii. In Yii (1.1) a lot of stuff happens behind your back. In Yii 1.1 routing was kind of a big topic, especially those who wanted/needed RESTful routing. In Laravel this is done very nicely. So even if you don’t use Laravel at the end, it will gives you some new thoughts.

Also if your deadline isn’t too close, you could spend more time on planning your software. You can think about model, controller, view logic without know which framework you are going to use and wait 1-2 months until Yii2 is a bit more mature. I think most people start writing code way too early anyway.

I completely agree with ORey - stick with Yii. I tried out Laravel4 for a personal project, which was a simple site where you write in daily entries. It was pretty fun learning a new framework, but I found it more frustrating than anything for the following reasons:

Not only is the code harder to understand, it’s also much harder to set up in your IDE. By default, you won’t be able to ctrl-click functions (go to declaration) and you won’t be able to utilize autocomplete.

You’d need to install a package (barryvdh/laravel-ide-helper) to do this, and it’s really annoying to use for the declaration feature. This is because it will direct you to the automatically generated file first, where you need to follow it again to the real declaration.

This is not even mentioning the terrible documentation Laravel has. Both in the official documentation and in many of searches, I’ve found that they tend to give code snippets instead of real documentation.

(The difference is that code snippets tell you what code to use, while documentation tells you why, where, and how to use that code.)

I found this too, mostly because of Yii Widgets. CGridView is amazing.

Interesting point about documentation. I’ve got a lot of complaints about not that much code in 1.1 docs so in 2.0 I’m adding more of these. Of course, all the code is described.

By Thanking Dear samdark and the framework development team.:D

May i ask you to include some example for class methods and property in documentation?B)

sometimes, I refer to the api documentation, I mixed up, and have to search again and again in Internet for a small method.:(

What do you mean?

When I find some method, I’m not sure about that method weather can solve my problem or not. So if there is some simple examples or useful links about methods or property, maybe so helpful. That is because of summarized descriptions.

For Example, The method countBySql() is better to show an example, I did not found its usage.

I loved Yii 1, and am excited for Yii 2. Ive had colleages tell me Laravel is great (whom havent used Yii themselves). I also want to learn the neuances of many popular frameworks.

So all in all im on the fence about my next big project - Yii 2 vs Laravel. Does anyone have any more concrete arguments from experience? While I myself seem to be leaning more towards Yii 2, the arguments in this thread arent that strong (in favor of Yii).

Laravel was my first framework. Now I use Yii because that’s what my company uses.

I can’t say which one I prefer more because both are very easy to learn and pick up. Though, like Shahcheraghean said, I really like Laravel style of documentation (, which basically is a distilled cookbook.

I can’t tell you how many time I make reference to this article: ( simply because it is so much faster than reading the API or reading the definitive guide (which is a wall of text).

Sample code as part of the API reference will be great.

Adding it where suitable. If you have any suggestions, create issues at github.

Maybe I can help with that.

Already have a couple of yii2 projects finished, there are some code samples I can share.

I’ll need a list of required topics to cover.

PS. Never used gii and extensions (like GridView) though, so only ‘vanilla’ code.

Cheers, when I’ll be able to do it, I will.

Is it possible to use Yii2 in PHP 5.3? if not, how thousand numbers of PHP5.3 servers can make benefit of Yii2?

No it is not possible. 5.3 reached its end of life and we do not want to encourage using outdated software that doesn’t receive even security fixes anymore.

The company that I bought the host does not support PHP 5.4. In this case i can not use Yii2 in Live Server :( and must be use the Yii 1.1. I like this framework. it,s wonderful and developer friendly. Thank you. :)