Example #1
0
 protected static function processController(Controller $aController)
 {
     // 执行子控制器
     foreach ($aController->iterator() as $aChild) {
         self::processController($aChild);
     }
     // 重定向输出
     if ($aController->bCatchOutput) {
         ob_start(array($aController->response(), 'write'));
     }
     // 执行自己
     try {
         // 检查权限
         if ($aController->autoCheckPerms()) {
             $aController->checkPermissions();
         }
         $aController->process();
     } catch (_ExceptionRelocation $aRelocation) {
     } catch (\Exception $e) {
     }
     if ($aController->bCatchOutput) {
         ob_end_flush();
     }
     if (!empty($e)) {
         throw $e;
     }
 }