MVC Frameworks?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

ben.artiss
Forum Contributor
Posts: 116
Joined: Fri Jan 23, 2009 3:04 pm

MVC Frameworks?

Post 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
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: MVC Frameworks?

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: MVC Frameworks?

Post 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.
(#10850)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: MVC Frameworks?

Post 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
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: MVC Frameworks?

Post 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 :)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: MVC Frameworks?

Post by Christopher »

CI is more full-stack so you can create an application instantly with it. And it is considerably lighter weight than Zend.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: MVC Frameworks?

Post 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
ben.artiss
Forum Contributor
Posts: 116
Joined: Fri Jan 23, 2009 3:04 pm

Re: MVC Frameworks?

Post 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?
blueyon
Forum Commoner
Posts: 76
Joined: Tue Oct 30, 2007 9:53 am

Re: MVC Frameworks?

Post by blueyon »

Check post I did out:

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

ZF people are really brain dead.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: MVC Frameworks?

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
ben.artiss
Forum Contributor
Posts: 116
Joined: Fri Jan 23, 2009 3:04 pm

Re: MVC Frameworks?

Post 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:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: MVC Frameworks?

Post by josh »

Passing by reference is the default in php5, that ampersand syntax is php4 homie. :wink:
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: MVC Frameworks?

Post 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.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: MVC Frameworks?

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: MVC Frameworks?

Post by Christopher »

First, EVERYTHING is lighter weight than Zend! ;) Second, you should just download CI and take a look.
(#10850)
Post Reply