News Feed
Sections




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

Karsten Deubert's Blog:
Zend_MVC, Controller Plugins and Annotations
November 28, 2011 @ 12:02:50

Karsten Deubert has a recent post to his blog looking at annotations in Zend Framework applications to enhance functionality already in the framework.

Recently I had the idea to influence Controller Actions with annotations but discarded it with thoughts like "In PHP I will have to use reflection and some black magic to get this working which will have insane performance hits for my applications"... until I set everything up to see that it costs just 1-2ms in average per request without any form of caching.

He includes a few bits of code to show a simple annotation example (setting a layout) and the controller plugin that performs the translation. In his case, it's hard-coded to look for the "@layout" annotation in the docblock comment, but it'd be relatively trivial to extend it to a more full-featured version.

0 comments voice your opinion now!
zendframework mvc controller annotations docblock comment plugin


blog comments powered by Disqus

Similar Posts

Robert Basic's Blog: Chaining routes in Zend Framework

Secunia.com: WordPress Issues - Two Plugins (wp-Table & wordTube) and a Debian Update

Mayflower Blog: Zend Framework Application.ini Cheat Sheet

Juozas Kaziukenas' Blog: Zend Framework and Doctrine. Part 3

Zend: Webinar Recording Posted - Zend Framework 1.0 - An Overview


Community Events





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


tips bugfix framework podcast api conference community laravel list series zendserver library release voicesoftheelephpant developer introduction deployment symfony interview language

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