views:

444

answers:

10

Something easy like CI (this means mandatory good, easy, up to date documentation). But also with some more features than CI.

Yii has lots of features, but it is also more complex (and it kind of forces you to have to use lots of it features). That means adding some functionality to your web-app takes three times as long because you have to figure out lots of new small functionalities of Yii.

It's kind of like the CI "gets out of your way" when it needs to, and Yii gets in your way, and if you don't do it its way, it breaks.

Features missing in CI that would be nice to have in this new "intermediate" PHP framework:

  • Code generation (crud).
  • Authentication.
  • Access control.
  • Layouts.
  • Widgets.
  • Easyer / automated pagination (like yii)
  • easy uri parameters

Where Yii causes me problems:

It's like for every small task there is some inbuilt functionality (this is good), but, YOU HAVE to use the inbuilt functionality, otherwise bad things happen. (CI gets out of your way, but does it too much, Yii helps a lot, but is butting in too much at times, and it forces you to sift through its documentation so that you discover these functions without which you are not able to accomplish a task that would take four time less, in CI, or in a non framework app).

Is there something in between ?

(ASP.NET MVC could be 'it', but I don't know the language, so the effort to learn it would be greater than learning Yii php framework really well, so I am looking for a PHP Framework)

+1  A: 

you could try kohana (especially coming from ci)

nathan
Kohana doesn't really provide the features OP asking about (although it *is* an excellent framework).
notJim
Kohana has less documentation than Yii, and docs. are not maintained well. It improves on CI, but it mostly fixes stuff in internals, and does not add many new features.
Milan Babuškov
@ nathan Yes, I understand what you are trying to say.Kohana (unfortuntely) is the exact oposite of ci, because the strongest point of ci is _not_ its features, but its excelent, concise, example filled documentation (where as yii`s strong point is its features, but has not as good documentation). In fact CI is criticised for some of it`s "features", yet is still very popular for some reason... And the reason is the docs.I checked out kohana (again), but... The problems it had before are still there.
snrp
PS. Kohana has some nice features thoo, I was impressed with the way you can type cast a view object as a string for example. This feature seemed to me very intuitive and very C# like.From the kohana documentation:// Render the view: $about_page = $view->render(); // Or just type cast it to a string: $about_page = (string) $view;Unfortunately, like I said, kohana has other problems. (also missing many of the features of yii)
snrp
+3  A: 

I am a fan of CakePHP. I feel it has the specs you provided. If you want something more cutting edge you can take a look at Lithium

Jason McCreary
Lithium requires PHP 5.3+, so may be less accessible. CakePHP has some backwards compatibility I believe, but not as much as CodeIgniter which still supports PHP 4.
Lotus Notes
I find CakePHP to be even worse than Yii regarding "you have to do stuff its way" the original question is about.
Milan Babuškov
So you give me a down vote for my recommendations? Interesting... Especially since your not even the original author.
Jason McCreary
@Jason, look at your first sentence: "I'm a fan of CakePHP"? That should be a very convincing argument to up-vote? Maybe if Yii author would write that ;) Second sentence... well, let's just say I disagree. Having used all 3 frameworks myself on big projects, CakePHP has the same problems, and even worse than Yii. Yes, it has the spec. of the problem, but not of the solution. Besides, original author cannot even downvote, he only has 11 reputation.
Milan Babuškov
In short, I've seen 3 answers so far, and none of them gives an answer worth voting up IMHO, because none of them solves the problem the original author is talking about. It seems to me that none of the people how replied so far have used both CI and Yii and they're just making wild guesses.
Milan Babuškov
@Milan. I was just offering alternatives. If you don't like my suggestion then don't take it or vote. I just think it's funny that you gave a down vote on a legitimate response, albeit *lame* in your opinion.
Jason McCreary
@Jason: that's what down-voting is for. It's not about being "legitimate", it's about solving the problem or not.
Milan Babuškov
+1  A: 

You should check out the CI community, some of those extensions maybe have been written by someone else (I remember seeing Authentication and Components/Widgets somewhere)

Symfony is worth checking out. I personally don't like it much because they chose Prototype over jQuery for their ajax features, which is really annoying to use when you're used to jQuery.

Lithium might be good to check out too. However, it is php 5.3 only and you need to be really careful that this version of PHP is going to be supported on the server the site will be deployed on.

Ben
A: 

For what its worth, if you're looking for a PHP Framework that is like ASP.NET MVC then I think Prado is the closest thing you will find.

seengee
A: 

You could have a look at Qcodo / Qcubed. They are both easy to pick up and offer code generation / ORM

Easy way to create forms in an mvc kind of way.

Mischa Kroon
+1  A: 

See this list for good comparisson:

http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#PHP_2

From a personal point of view, I would go with symfony because of it's

  • rich features and
  • great integration with many other already bundeled components (Doctrine, Swift Mailer,..),
  • good (but at first complex) code generation that produces realy useable code to get you startet quickly,
  • powerfull use of templating (that will be the point you mention under "layouts)
  • many different, powerfull plug-ins, including Authentication & Access Control (it also has a plug-in to get jQuery support)
  • one of the best tutorials that I've seen with a framework

Downside is a

  • more complex structure,
  • IMO wired file structure,
  • a rather messy API documentaion compared to the tutorial

CodeIgniter is a nice framework if you don't want to create big apps but it lacks a great database integretaion and you already mentioned code generation.

DrColossos
+1  A: 

I've used both CI and Yii (on my own projects if that makes any difference). CI was my first introduction to MVC, and I found it easy going because it let me use any crappy structure and code. I wrote two full sites in CI (www.insolvencynews.com and www.thebigeat.com if you want to see complexity.)

I had a look at CakePHP but got NOWHERE.

Then I moved on to Yii and, like you, I found it pretty tough and rigid. But I then found that it was so powerful and extensible that I was so much more efficient. When I needed to add a few new features to the old CI sites, it was faster to rewrite the entire sites on Yii than to code up the extra features in CI.

I can't recommend a framework in the middle, but I can recommend sticking with Yii. When you say Yii gets in the way, can you give an example? Looking at DB stuff (in ascending order of dependence on Yii):

  1. you can code using PHP's core MySQL functions.

    $result = mysql_query($sql);

  2. you can use Yii's DB abstraction layer.

    Yii::app()->db->createCommand($sql)->queryAll();

  3. You can use Yii's ActiveRecord:

    Takeaway::model()->findAll();

Moyersy
You can`t just splat some code in there and get it over with. You have to use all sort of over-complexed methods.Ex: "manually" implementing a jquery-ui tabs. You have to "discover" the Yii::app()->clientScript->registerScriptFile() function first. But if you didnt know it exists in the first place, how do you "discover" it? When you search on google for how to get it to work. I dont think it explains anywhere in the documentation how to load the jquery that is "bundled" with yii and that is used for ajax pagination and stuff, or that you even can or are suposed to do such a thing.
snrp
I hear you - the documentation's inadequate. You've still got two options with Yii though: Code your own javascript handling in PHP, or just whack <script> tags in the view. You're not forced to use Yii's methods - but IMHO learning them and using them is faster than starting from scratch.
Moyersy
+1  A: 

I have found some resources that kindof solve the problem, because they contain examples (Milan Babuškov's sugestion helped focus on "the solution").

Yii playground - examples Yii cookbook - examples Yii blog tutorial - more examples

PS. there is also google - I find solution (and examples) the fastest this way - ex: implement + pagination + yii

snrp
A: 

I am a fan of Yii and i have some years with CI. It should be "Yii is in the middle of CI and Symfony" in my point of view. Also if you want Yii to do what CI can do assuming you are new to both then Yii is easier to learn! Only the advanced features of Yii will make you confused due to lack of samples (their document is good actually,if you spent enough time).

Now i moved from CI and Symfony to Yii and decide to stick with it (unless my clients ask specifically). CI's Expression Engine makes a little disappointed after 2.0 release and there is not many things new compare to the older version (maybe new price i believe). A new face join in CMS world is FlexicaCMS which is based on Yii is worth to look at. Check out the developer features it has (http://www.flexicacms.com/features.html) and you can learn Yii advanced features in its code

Pokamy
A: 

im very good in Raw PHP, where the project at hand became too much to handle i decided to move to zend, with too too much complexity i finally moved to YII which really reduced the cost and overhead time for project development and most importantly for me is the simple integration of jquery, widget and advanced-OOP.

binkabir