I am not a fan of Zend Framework either. Personal tastes and the fact that I code with CodeIgniter as my framework. It is far easier to get a CI site up and running than the Zend system, where there are plenty of config files to meddle with.
The MVC system in CI tends to be more straight forward.
The downfall of CI is that it still retains a lot of php 4 at its core so you cannot really expect to get down and dirty with interfaces. If you have a php 5 stack you can utilize abstract classes pretty well in CI 1.7.2 and 2.0beta. If you need a more rubust php5.3 stack then you should use Kohana 3. Kohana v1 and v2 are based off of CI. 3.0 is a complete rewrite and takes advantage of php 5.
CI is very easy to setup and use. It doesn’t force you to use MVC and lets you get working systems with minimal MVC tech. However, as you grow as a MVC developer you will find that CI can be very, very MVC savvy and you’ll want to take advantage of it. Also, you’ll come to find that writing in php 5 can make MVC apps wonderfully easy to manage.
For instance, if you wanted to write a driver for importing data from csv files, or xml files etc you can write an abstract class that has all the methods without implementations… or some that will always be the same despite the type of child class so they will be implemented in the class. Then you just need to extend it and implement the system yourself. The app will be clean, easy to manage etc.
Also, another thing about MVC and OOP…
Extending Controllers by making a base controller ( and you can do the same with models ).
So for example in CI when you extend a core library you have to prefix it with MY_
Thus, MY_Controller.php would be in your library directory for the appliation:
class MY_Controller extends Controller {
public function __construct()
{
parent::Controller();
}
}
Then you can then make a Public_Controller that extends MY_Controller and an Admin_Controller that also extends MY_Controller. In MY_Controller you might want to initialize some session information for all users. Then in the Admin_Controller you can tighten up with security checks and route them to an admin field.
Not that you cannot do this in Zend… but I find it easier to implement in CI. The good things about Zend is that there are a lot of core libraries built for interacting with web services. These usually are 3rd party with CodeIgniter and you can find tons of 3rd party libs on bitbucket or github.
There are already mongoDB libraries, authorize.net libs, paypal etc etc for CI ready to be tapped. Also modular separation libraries so you can build apps more modularly ( which I find a god send ).
/application
-config
-controllers
-helpers
-library
-models
-views
If you did modular separation, once you install the few files from the library where they need to go, you’d add a directory called modules to the app directory then you can mirror those above in a new directory in the modules directory. So if you want to create an accounting module
/application
-modules
–accounting
—config
—controllers
—libraries
—models
—views
your controller needs to be named accounting.php in the controllers directory of your module… but you can do local module routing in a routes.php file in your —config folder that can route accounting/new controller method when what you are really asking for is a second controller’s method that is in the same directory of —controllers.
example:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| http://codeigniter.com/user_guide/general/routing.html
|
*/
$route['accounting/payment(:any)?'] = "gateway/start$1";
/* End of file routes.php */
/* Location: ./system/application/modules/accounting/config/routes.php */
So when you call http://www.yoursite.com/accounting/payment/5
The module’s route is passing off the payment method of the URL to another controller in the directory with the accounting controller with a uri segment ( say a payment ID ) with 5.
Very, Very good way to build your apps.
Anyways… the real crux of MVC learning is to understand what you are doing with the URL routing and how it maps to your application files. Then start tinkering with the libraries in the controller, then break down things to keep it DRY ( Don’t Repeat Yourself ). This can take weeks to years to really grasp it, so just start doing it!