News Feed
Sections




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

Rob Allen's Blog:
Using your own View object with Zend_Application
February 16, 2011 @ 10:38:32

In the latest post to his blog Rob Allen shows you how to create a custom View object for your Zend Framework application with the help of the Zend_Application component. It uses one of two ways to set up this custom view object - either in the bootstrap or as a custom resource.

Let's say that you want to use your own view object within your Zend Framework application. Creating the view object is easy enough in library/App/View.php along with adding the App_ namespace to the the autoloader in application.ini. All we need to now is get Zend_Application to bootstrap with our new view class. There are two ways of doing this: within Bootstrap.php or using a custom resource.

He includes the code to make it happen both ways - by adding an _initView method in the application's Bootstrap.php file or by creating a new class called App_Resource_View that overrides the getView() method that grabs the custom object.

0 comments voice your opinion now!
zendframework view object custom tutorial bootstrap resource


blog comments powered by Disqus

Similar Posts

Liip Blog: Using the Symfony2 console

Elizabeth Smith's Blog: Treeviews and Cell Renderer Properties - Practical PHP-GTK

Padraic Brady's Blog: Zend Framework: Surviving The Deep End Book - Chapters 4, 5, 6, 7 and Appendix

NetBeans Blog: PHPUnit support added

Make Me Pulse Blog: Serialize and Unserialize SimpleXML in php


Community Events

Don't see your event here?
Let us know!


language example interview series laravel5 php7 opinion release api introduction install library extension podcast unittest xdebug voicesoftheelephpant laravel community framework

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework