2010-11-23 10 views

答えて

2
$front = $this->getFrontController(); 
    $acl = array(); 

    foreach ($front->getControllerDirectory() as $module => $path) { 

      foreach (scandir($path) as $file) { 

        if (strstr($file, "Controller.php") !== false) { 

          include_once $path . DIRECTORY_SEPARATOR . $file; 

          foreach (get_declared_classes() as $class) { 

            if (is_subclass_of($class, 'Zend_Controller_Action')) { 

              $controller = strtolower(substr($class, 0, strpos($class, "Controller"))); 
              $actions = array(); 

              foreach (get_class_methods($class) as $action) { 

                if (strstr($action, "Action") !== false) { 
                  $actions[] = $action; 
                } 
              } 
            } 
          } 

          $acl[$module][$controller] = $actions; 
        } 
      } 
    } 
+0

それは動作します。ありがとうございました。 –

関連する問題