Yii Framework Forum: How Does The Yii Deal With The Challenges From Laravel? - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

How Does The Yii Deal With The Challenges From Laravel? We want more information about yii2

#1 User is offline   qiansen1386 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 03-May 13

  Posted 03 November 2013 - 02:11 AM


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.

0

#2 User is offline   qiansen1386 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 03-May 13

Posted 03 November 2013 - 02:14 AM

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.
0

#3 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,649
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 03 November 2013 - 03:20 AM

*
POPULAR

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.

2. 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.

3. 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.

4. (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.

5. Their coding style is crap.
if($user->isAdmin())
{
..
}

(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!

6. 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.

Quote

The most important question i guess when we could actually use it for developing.


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.
God is real unless declared as integer
10

#4 User is offline   qiansen1386 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 03-May 13

Posted 05 November 2013 - 09:05 PM

 ORey, on 03 November 2013 - 03:20 AM, said:

I've worked with laravel 4 a little. My opinion: you should go with 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
0

#5 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,149
  • Joined: 17-January 09
  • Location:Russia

Posted 06 November 2013 - 04:53 AM

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).
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
2

#6 User is offline   Tropi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 30-November 11

Posted 07 November 2013 - 08:32 PM

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: https://github.com/y...lopment-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.
1

#7 User is offline   amnah 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 68
  • Joined: 23-February 13

Posted 10 November 2013 - 02:09 AM

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:

 ORey, on 03 November 2013 - 03:20 AM, said:

2. 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.


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.)

 ORey, on 03 November 2013 - 03:20 AM, said:

6. 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.


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

#8 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,149
  • Joined: 17-January 09
  • Location:Russia

Posted 10 November 2013 - 10:03 AM

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.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
4

#9 User is offline   Shahcheraghean 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 478
  • Joined: 12-December 12
  • Location:Mashhad, IRAN

Posted 10 November 2013 - 11:44 AM

 samdark, on 10 November 2013 - 10:03 AM, said:

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.:(
www.shgn.ir
www.shgn.ir/yii-framework/
yii2.swsco.ir
In a world without any fences or walls,Who needs Gates or Windows!
0

#10 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,149
  • Joined: 17-January 09
  • Location:Russia

Posted 10 November 2013 - 12:21 PM

What do you mean?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#11 User is offline   Shahcheraghean 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 478
  • Joined: 12-December 12
  • Location:Mashhad, IRAN

Posted 11 November 2013 - 12:32 AM

 samdark, on 10 November 2013 - 12:21 PM, said:

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.
www.shgn.ir
www.shgn.ir/yii-framework/
yii2.swsco.ir
In a world without any fences or walls,Who needs Gates or Windows!
0

#12 User is offline   Stratigos 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 14-September 11
  • Location:BROOKLYN

Posted 13 December 2013 - 01:30 PM

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).
0

#13 User is offline   surmay81 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 15-January 14

Posted 15 January 2014 - 02:11 AM

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 (laravel.com/docs/eloquent), which basically is a distilled cookbook.

I can't tell you how many time I make reference to this article: (yiiframework.com/wiki/48/by-example-chtml) simply because it is so much faster than reading the API or reading the definitive guide (which is a wall of text).
1

#14 User is offline   Boaz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 344
  • Joined: 23-January 11

Posted 27 January 2014 - 11:14 AM

 Shahcheraghean, on 10 November 2013 - 11:44 AM, said:

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.:(


Sample code as part of the API reference will be great.
Therapeutic PHP sessions My LinkedIn Profile
1

#15 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,149
  • Joined: 17-January 09
  • Location:Russia

Posted 27 January 2014 - 11:44 AM

Adding it where suitable. If you have any suggestions, create issues at github.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
1

#16 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,649
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 27 January 2014 - 12:06 PM

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.
God is real unless declared as integer
1

#17 User is offline   Boaz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 344
  • Joined: 23-January 11

Posted 27 January 2014 - 02:36 PM

 samdark, on 27 January 2014 - 11:44 AM, said:

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


Cheers, when I'll be able to do it, I will.
Therapeutic PHP sessions My LinkedIn Profile
0

#18 User is offline   Masoud Sawari 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 24-January 14
  • Location:Iran, Khuzestan, Ahwaz

Posted 25 February 2014 - 02:35 AM

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

#19 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,149
  • Joined: 17-January 09
  • Location:Russia

Posted 25 February 2014 - 05:57 AM

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.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
3

#20 User is offline   Masoud Sawari 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 24-January 14
  • Location:Iran, Khuzestan, Ahwaz

Posted 25 February 2014 - 08:57 AM

 samdark, on 25 February 2014 - 05:57 AM, said:

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. :)
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users