News Feed
Sections




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

Robert Basic:
Working with custom view helpers in Zend Framework 2
September 12, 2012 @ 09:27:08

In his latest post Robert Basic looks at working with custom view helpers in your Zend Framework 2 application and shows how to implement a simple one to display a simple greeting.

I took the skeleton [Zend Framework 2] application, made it even skinnier by throwing out some (for me) unneeded parts and just put it all besides my old ZF1 code. [...] The first problem I ran into was using custom view helpers, especially view helpers that are more general and don't fit into one specific module. Where to put the code? How to access them in views? The second problem was how to access the service manager from a view helper? And the third problem was how to tell the helper to use a specific value when inside a specific module?

He includes a simple example - the greeting helper - and shows where to place it in the application structure, how to work with the service locator inside it and how to set up some module-specific views inside.

0 comments voice your opinion now!
zendframework2 view helper custom tutorial


blog comments powered by Disqus

Similar Posts

Ralph Schindler's Blog: The Anatomy Of A Bug/Issue Reproduction Script

Stuart Herbert's Blog: Dealing With PEAR Dependency Quirks

Maarten Balliauw's Blog: Reuse Excel business logic with PHPExcel

Sudheer Satyanarayana's Blog: XML RPC Client Using PHP PEAR - A Real World Example: Ping Technorati

NETTUTS.com: 3 Ways to Speed up Your Site with PHP


Community Events





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


community laravel series library podcast list framework opinion deployment interview release voicesoftheelephpant symfony tips install language package bugfix introduction api

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