Page 1 of 6

MVC Frameworks?

Posted: Tue Oct 27, 2009 9:14 am
by ben.artiss
Hi everyone,

I've been diggin my nose into CodeIgniter recently, and I was so impressed with the way they've done it I nearly wet myself. But then people start telling me that the Zend framework is better and more supported. Trouble is, I've been on the Zend website, and (assuming it's made using Zend), it's really slow compared to CI.

Does anyone have any opinions on whether one outweighs the other? In my opinion... CodeIgniter puts Zend to shame but that's really based on little knowledge of Zend.

Any opinions welcome, I'm just curious! Thanks in advance.

Ben

Re: MVC Frameworks?

Posted: Tue Oct 27, 2009 12:02 pm
by JNettles
All depends on what you need to do and what your requirements are, really. I usually roll my own unless a client demands a specific framework for some uninformed reason.

Re: MVC Frameworks?

Posted: Tue Oct 27, 2009 1:45 pm
by Christopher
I would say use the one you are excited about. You will learn valuable things about both frameworks and MVC with all of them. In a year you may branch out to other frameworks, or be even clearer that your first pick was right for you.

Re: MVC Frameworks?

Posted: Tue Oct 27, 2009 4:37 pm
by josh
Yes the ZF site does use Zend Framework, and their main site uses Magento now too, to sell their training packages and what not

Re: MVC Frameworks?

Posted: Tue Oct 27, 2009 6:18 pm
by alex.barylski
What is it about CI that appeals to developers new to MVC:

List your reasons specifically related to CI and Zend here please :)

Re: MVC Frameworks?

Posted: Wed Oct 28, 2009 12:43 am
by Christopher
CI is more full-stack so you can create an application instantly with it. And it is considerably lighter weight than Zend.

Re: MVC Frameworks?

Posted: Wed Oct 28, 2009 1:46 am
by alex.barylski
What do you mean by full stack? CI from what I can tell comes with an index.php already implemented and ready to go, so all you need to do is start creating controller:actions and echo'ing stuff to the screen. A relatively simple setup which I am sure you are aware.

Doesn't Zend have a bootstrap via Zend_Application or something which does almost the same thing? Possibly I misunderstood it's intent.

I think is about par with CI in terms of available fucntionality (databases, session, openid, etc). It seems to me it's just missing that one critical aspect that lets developers install the framework and immediately start coding applications, as opposed to having to implement boiler plate code, which is the appeal for many Zender's I would imagine as CI boostrap is missing or includes functionality I might put in other places.

Cheers,
Alex

Re: MVC Frameworks?

Posted: Thu Oct 29, 2009 5:42 am
by ben.artiss
Cool thanks for the input. It's not really fair for me to start weighing the pros and cons between the two because I don't know enough about ZF (other than it was more complicated to start a project with than CI). What I really love about CI is their approach to handling objects; the way everything is logically passed around between the MVC. I think the 3 main things I like about CI are:
  • $this->load
  • Session class (especially Flashdata)
  • Clear documentation
And what I really like is that I finally understand what the code below means thanks to CI (I never understood the whole passing by reference part):

Code: Select all

$CI =& get_instance();
Overall I feel in control with CI whereas I know I'd be fighting ZF all the time, but you can't exactly get CI certified at the mo... so maybe it's time to get knee deep in ZF?

Re: MVC Frameworks?

Posted: Thu Oct 29, 2009 7:12 pm
by blueyon
Check post I did out:

http://www.sitepoint.com/forums/showthread.php?t=640344

ZF people are really brain dead.

Re: MVC Frameworks?

Posted: Thu Oct 29, 2009 7:47 pm
by VladSun
PCSpectra wrote:What is it about CI that appeals to developers new to MVC:

List your reasons specifically related to CI and Zend here please :)
My first MVC framework I used was CI. I hate it :) but I still use it because of its simplicity and the fact that I know how it works in details (I do agree it's not the best OOP I've seen ;) ).

Now I use a very modified version of CI, because its core classes didn't fit my needs. Also, my Views (the "HTML" ones) are simple json_encode calls, so I don't miss any of the "View" related functionality which I've seen in other frameworks, but not in CI.

Re: MVC Frameworks?

Posted: Thu Oct 29, 2009 8:28 pm
by ben.artiss
I did stumble across an old MVC tutorial today (one I read a while ago before getting into CI), and it triggered that urge in me to build my own framework again... perhaps with a little more insight and confidence in the MVC pattern - which CI helped with nicely - I can really start playing. I'm sure I'll be posting back with questions in the Code forum soon enough :lol:

Re: MVC Frameworks?

Posted: Fri Oct 30, 2009 3:52 am
by josh
Passing by reference is the default in php5, that ampersand syntax is php4 homie. :wink:

Re: MVC Frameworks?

Posted: Fri Oct 30, 2009 6:15 am
by Eran
Passing by reference is only the default for objects. Other data structure pass by value by default. In either case, run-time pass by reference is deprecated, it should only be used in method declaration if necessary.

Re: MVC Frameworks?

Posted: Fri Oct 30, 2009 3:48 pm
by alex.barylski
My first MVC framework I used was CI. I hate it but I still use it because of its simplicity and the fact that I know how it works in details (I do agree it's not the best OOP I've seen ).
Interesting, but how is it more simple than Zend specifically? Is it because the dependency injection approach that Zend uses like the number of classes it takes to accomplish a task?

Re: MVC Frameworks?

Posted: Fri Oct 30, 2009 4:49 pm
by Christopher
First, EVERYTHING is lighter weight than Zend! ;) Second, you should just download CI and take a look.