Introducción a Zend Framework

 Aprendiendo Zend Framework

Apéndice

 Referencia de Zend Framework


  • Zend_Gdata
  • Zend_Http
  • Zend_InfoCard
  • Zend_Json
  • Zend_Layout
  • Zend_Ldap
  • Zend_Loader
  • Zend_Locale
  • Zend_Log
  • Zend_Mail
  • Zend_Markup
  • Zend_Measure
  • Zend_Memory
  • Zend_Mime
  • Zend_Navigation
  • Zend_Oauth
  • Zend_OpenId
  • Zend_Paginator
  • Zend_Pdf
  • Zend_ProgressBar
  • Zend_Queue
  • Zend_Reflection
  • Zend_Registry
  • Zend_Rest

  • Zend_Search_Lucene
  • Zend_Serializer
  • Zend_Server
  • Zend_Service
  • Zend_Session
  • Zend_Soap
  • Zend_Tag
  • Zend_Test
  • Zend_Text
  • Zend_TimeSync
  • Zend_Tool
  • Zend_Tool_Framework
  • Zend_Tool_Project
  • Zend_Translate
  • Zend_Uri
  • Zend_Validate
  • Zend_Version
  • Zend_View
  • Zend_Wildfire
  • Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Traducción al 26.9% - Actualizado el 2011-11-16 - Revisión 24249 - Versión ZF 1.11.x

    62.2. Zend_Server_Reflection

    62.2.1. Introduction

    Zend_Server_Reflection provides a standard mechanism for performing function and class introspection for use with server classes. It is based on PHP 5's Reflection API, augmenting it with methods for retrieving parameter and return value types and descriptions, a full list of function and method prototypes (i.e., all possible valid calling combinations), and function or method descriptions.

    Typically, this functionality will only be used by developers of server classes for the framework.

    62.2.2. Usage

    Basic usage is simple:

    $class    Zend_Server_Reflection::reflectClass('My_Class');
    $function Zend_Server_Reflection::reflectFunction('my_function');

    // Get prototypes
    $prototypes $reflection->getPrototypes();

    // Loop through each prototype for the function
    foreach ($prototypes as $prototype) {

        
    // Get prototype return type
        
    echo "Return type: "$prototype->getReturnType(), "\n";

        
    // Get prototype parameters
        
    $parameters $prototype->getParameters();

        echo 
    "Parameters: \n";
        foreach (
    $parameters as $parameter) {
            
    // Get parameter type
            
    echo "    "$parameter->getType(), "\n";
        }
    }

    // Get namespace for a class, function, or method.
    // Namespaces may be set at instantiation time (second argument), or using
    // setNamespace()
    $reflection->getNamespace();

    reflectFunction() returns a Zend_Server_Reflection_Function object; reflectClass() returns a Zend_Server_Reflection_Class object. Please refer to the API documentation to see what methods are available to each.

    digg delicious meneame google twitter technorati facebook

    Comentarios

    Loading...