Advertisement
NFL

Zend reflection example

NFL
Oct 16th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @controller=Test
  5.  */
  6. class TestController extends Zend_Controller_Action {
  7.  
  8.     /**
  9.      * @title Тестовое действие
  10.      * @desc о_О
  11.      */
  12.     public function indexAction() {
  13.         require_once(APPLICATION_PATH . '/controllers/ShopController.php');
  14.         $r = new Zend_Reflection_File(APPLICATION_PATH . '/controllers/ShopController.php');
  15.         $t = $r->getClasses();
  16.         $class = $t[0]->name;
  17.         foreach ($t as $v) {
  18.             $methods = $v->getMethods();
  19.             foreach ($methods as $m) {
  20.                 if (($m->class == $class) && (strpos($m->name, 'Action') !== false)) {
  21.                     $ann = $m->getDocblock()->getTags();
  22.                     foreach ($ann as $a) {
  23.                         echo $a->getName() . ': ' . $a->getDescription() . '<br>';
  24.                     }
  25.                 }
  26.             }
  27.         }
  28.         exit;
  29.     }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement