views:

8361

answers:

15

I've been using Code Igniter for my PHP projects, when I start them from the beginning. It is very nice framework, saves me a lot of work and let me have low level access if I need to do something special.

Code Igniter is also faster then similar frameworks by order of magnitude. I came across Yii framework which claims to be even faster and easier and prettier and whatever.

I never heard of it and I was wondering if someone used it in some real life project and have practical experience that he is willing to share.

+2  A: 

Yii Framework and the phpmark tool that is used for the benchmarks is written by the same author (qiang.xue)
Therefore the performance stats are (probably) tuned to the strengths of yii.

I have no personal experience with yii, sorry.

Bob Fanger
+8  A: 

This is a nice comparison of CakePHP, CodeIgniter, and Yii. Notice that his benchmark's results are considerably different than those shown by Yii. Hopefully he will post Part 2 of the comparison soon, which will probably contain a lot more useful information for deciding on a framework.

Chad Birch
Sorry to say, but that benchmark is being influenced by variations in the CPU allocation, SO it's not a reliable source. The author says "Yii used a dedicated server for the tests. I used the shared hosting service where I’m going to deploy my actual application. Thus, Yii’s benchmark is more technically fair, but mine might give a better impression of real world behaviour."So no, the benchmark is not well-written (read: isolated, as any benchmark MUST be), nor can its data be trusted.
Flavius
+6  A: 

I've been using Zend Framework for some bit of time, but then I went away from it. Indeed, ZF is a masterpiece in terms of software development patterns and practices, BUT it has less to do with REAL life requirements.

Guess what I'm using now? Exactly, Yii :) While not an expert at it (yet), I have the feeling that it simply fits better practical, but yet purist php programmers.

As for the benchmark, I don't rely on it, I simply say how yii feels: slim.

NOTE: And yes, I DID learn a lot from ZF, and YES, I'll use some of its components here and there. BUT I'll keep on using Yii as the main framework.

Flavius
+1  A: 

It looks a nice framework to me. Certainly feature rich and much more OO than CI. No, I haven't used it for any real world projects yet. But I'll be keeping a cloce watch on it as I think it has all the things to become the framework of choice for PHP.

Niran
+1  A: 

Here is another comparison of Yii versus CodeIgniter, with an additional comparison against Kohana to boot.

Cal Jacobson
+4  A: 

Yii is an awsome PHP framework. I'm using it for a major project I'm currently developing.

I was using CodeIgniter, but switched to Yii, with no regrets I might add. CI is great for beginners who are just starting out with MVC, but if you want to dig a little deeper and get more into OO, like Carl Jacobson said, then Yii is the way to go.

Yii has excellent documentation and a very active forum community. Qiang Xue, the developer, knew exactly what he was doing with Yii and the guy, to my liking, is a genius.

From my personal experience, Yii is faster that CI

+2  A: 

I like Yii more than Code Igniter. Yii loads only what's really necessary for your current page to work. Try yiic (Yii command line tool). Also here is a small Yii project i'm working on that might help you understand Yii better: http://code.google.com/p/web3cms/

+1  A: 

Zend or Yii - thats the Question of the Day. Zend is pretty and Yii is pretty.. AIDS or Plague :) => http://php-frameworks.net/frameworks/

I think i will use Yii .. sry my english is horrible ^^

Terrahawk
A: 

I am using CI for past one year and feel very easy to work with it..i tried using YII some parts are excellent like the CRUD etc but i personally feel that Yii has a steep learning curve as compared to CI. that was the only reason i prefer CI over YII

BliTzk
no need for -1=)
weng
+1  A: 

I'm currently using Yii for a project (pet project outside of working hours), and so far I have to say that I love it. I have come across a couple of problems, but nothing that can't be solved with a work-around (i.e. no more than a single database connection per application).

There can be a very steep learning curve if you are not experienced in MVC and OO concepts, but the reward is worth the effort in learning.

Scott Deagan
You *can* have multiple database connections per application.http://www.kevinbradwick.co.uk/2010/05/using-multiple-database-connections-with-yii-framework/
Jonah
A: 

read the documentation http://www.yiiframework.com/doc/api/CDbConnection :-)

Ivo
+2  A: 

to use 2 db connection you can try putting another db component into the configuration file, like so:

array(
'components'=>array(
    'db'=>array(
        'class'=>'CDbConnection',
        'connectionString'=>'sqlite:path/to/dbfile',
    ),
    'anotherDb'=>array(
        'class'=>'CDbConnection',
        'connectionString'=>'sqlite:path/to/anotherdbfile',
    ),
),

access it like so:

$firstDb = Yii::app()->db;
$firstDb->active = true;
// etc, then
$secondDb = Yii::app()->anotherDb;
$secondDb->active = true;
ZaQ
+1  A: 

I have used Yii for 6 months now and am on my 3rd project.

I considered using:

CI, Kohana 3, Symfony

Kohana 3 was not so well documented and I ran into some development problems. Symfony had a buggy release that put me off. CI seemed a little behind the times (PHP4).

In the last 6 months Yii has gathered noticeable momentum. The team members are very quick to react to suggestions. 3rd party extensions are being added most days. The framework is evolving well with minimal upgrade issues. The forum has more examples now.

Learning curve - yes there is one but most answers can be found on the forum.

Positives: Very flexible, fast to develop thanks to the generator Most common features already exist The applications seem to run quickly under current loads Good documentation. Easy to extend. Able to be used in conjunction with other frameworks but I ahve not needed to do this.

Negatives: Medium learning curve Some examples/walkthroughs are a little out of date after a new release - hopefully these will be updated.

Summary:

I would recommend Yii for people with moderate/good PHP experience and will continue using it for all possible projects - I haven’t found any projects that it is not suitable for yet.

A: 

A new CMS system based on Yii 1.1.2 has just been released. This looks to be the first Yii CMS with complete design and fully functional. Worth to check out.

Pokamy
+1  A: 

I have used Yii for a couple of projects and I love it. I have dabbled with CodeIgniter, Zend and Cake, but since I wasn't too deeply married to any of them yet I decided it was worth looking around and picking the "best" framework, instead of the "most popular" one. My research led me to choose Yii.

It has a sensible MVC layout, good documentation, it's actively developed, has a good community, it's fast (enough), and talk about features: OOP PHP5, Ruby style "mixin" capabilities via Behaviors, a robust Event system for building hooks/listeners, internationalization features, a nice ActiveRecord system, jQuery built in (AJAX friendly), a great caching system, etc, etc.

If you are already used to a particular framework you should probably stick with that one, but if you are looking to pick a Framework to learn I would recommend Yii, it's been good for me.

thaddeusmt