Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Federico Cargnelutti's Blog:
An Alternative to Zend_Controller: The Model
Apr 14, 2009 @ 13:48:46

Federico Cargnelutti has posted the third part of his series looking at his alternative to the normal Zend_Controller in Zend Framework applications - Zf_Controller. This article focuses on its interface with the model.

The domain layer is separated from the other layers and has no dependencies on Zf_Controller. Adding the domain directory to your include path allows you to load and access Model classes from anywhere within your project.

His code examples show an IndexController extending the Zf_Controller and how a Model can be called from inside it through a getInstance (as long as the model directory is in your path). You can take a look at part one and part two for more information on this alternative component.

tagged: zfcontroller zendcontroller model interface getinstance includepath

Link:

Federico Cargnelutti's Blog:
An Alternative to Zend_Controller: The Router
Apr 09, 2009 @ 13:44:44

Federico has continued his look at his alternative to the Zend_Controller component of the Zend Framework - Zf_Controller in this new part of the series focusing on routing.

Here’s the good news: Zf_Controller doesn’t have a Router. It uses a very simple mapping to determine the name of the controller and action.

He gives an example of the "non-routing" and how to work with the input variables for the controller instance - defining default values and setting requirements for them (as defined by matching a regular expression).

You can read more about the first part of the series here.

tagged: zendcontroller zendframework alternative router variable zfcontroller

Link:

Federico Cargnelutti's Blog:
An Alternative to Zend_Controller: Introduction
Apr 08, 2009 @ 18:43:47

Federico Cargnelutti has made a new post about an alternative Zend Framework developers can user instead of the normal Zend_Controller - his Zf_Controller.

Zend Framework is very flexible and one of its strengths is that it allows developers to implement their own components. The Zend_Controller component, for example, is very powerful. Of course, it’s not my intention to replace it, but to offer an alternative that decreases the number of decisions a developer needs to make when developing an application. Meet Zf_Controller.

His controller allows for better backwards compatibility, better performance, removes the need for circular references and drops the need for Singleton classes. He includes an example of the updated directory structure the class would use, a bootstrap comparing with/without the new class and the rest of the scripts needed for a sample application (view, layout, error controller, etc).

tagged: zendcontroller zendframework alternative zfcontroller

Link:

PHPImpact Blog:
Improving the performance of Zend_Controller
Jul 15, 2008 @ 14:32:23

The PHP::Impact blog has a quick performance tip posted today for all of the Zend Framework-ers out there that are seeing some poor performance with their Zend_Controllers.

Zend_Controller_Front gets an instance of Zend_Controller_Router_Rewrite, routes the request, iterates through all the provided routes and matches its definitions to the current request URI. The problem with this is that the more routes you add, the more time the router will take to find a positive match.

Federico includes a few benchmarking stats to back this up ranging from four routes up to forty. His solution is to place the routes in different files and set the location with a Zend_Config_Ini object. This makes the controller only load the ones that are needed instead of pulling all forty into memory to have to parse through.

tagged: performance zendframework zendcontroller routing route

Link:


Alexander Netkachev's Blog:
Zend_Controller classes
Jan 18, 2007 @ 13:06:25

On his blog today, Alexander Netkachev has charted out some of the new functionality in the latest version (0.6.0) of the Zend Framework as pertaining to improvements in the Zend_Controller.

Zend Framework 0.6.0 release comes with improvements in Zend_Controller area (new Zend_Controller_Request, Zend_Controller_Response classes, dispatch process improvements), which looks very promising. Dispatching process now better described and its parts (Zend_Controller_Router and Zend_Controller_Dispatcher) are replaceable.

He also includes a diagram of how it's all laid out and a brief description of how each of these new pieces works.

tagged: zendframework zendcontroller component request response dispatch diagram zendframework zendcontroller component request response dispatch diagram

Link:

Alexander Netkachev's Blog:
Zend_Controller classes
Jan 18, 2007 @ 13:06:25

On his blog today, Alexander Netkachev has charted out some of the new functionality in the latest version (0.6.0) of the Zend Framework as pertaining to improvements in the Zend_Controller.

Zend Framework 0.6.0 release comes with improvements in Zend_Controller area (new Zend_Controller_Request, Zend_Controller_Response classes, dispatch process improvements), which looks very promising. Dispatching process now better described and its parts (Zend_Controller_Router and Zend_Controller_Dispatcher) are replaceable.

He also includes a diagram of how it's all laid out and a brief description of how each of these new pieces works.

tagged: zendframework zendcontroller component request response dispatch diagram zendframework zendcontroller component request response dispatch diagram

Link:


Trending Topics: