2011年5月31日星期二

Slawek Lukasiewicz's Blog: Zend Framework: Reflection


Slawek Lukasiewicz has a recent post to his blog looking at a tool that comes bundled with PHP that can help you find out more about your own code (or really any other piece of code out there) - the Reflection API. In his post he looks specifically at the functionality the Zend Framework has built on top of the base PHP API.



Zend Framework has own Reflection extension. It is mostly build upon genuine PHP Reflection API and extends existing features. The completely new Zend_Reflection module feature is introspection of docBlock tags.


He includes two code examples using this component of the framework - grabbing the docblock off of a specific method (and even how to grab specific tags from inside it) and how to grab the body content out of a given method, with or without the docblock attached.

没有评论:

发表评论