예제 #1
0
파일: Filter.php 프로젝트: vucms/aha
 /**
  * @brief 所有路由之前注册的回调的call 之后是路由
  * @param \Aha\Mvc\Aha\Mvc\Dispatcher $dispatcher
  * @param array $data
  * @return string
  */
 public function preRouter(\Aha\Mvc\Dispatcher $dispatcher, array $data = array())
 {
     if (!isset($data['cbIndex'])) {
         $data['cbIndex'] = 0;
     }
     $cbIndex = $data['cbIndex'];
     if (!isset($this->_arrPreRouter[$cbIndex])) {
         return $dispatcher->routeLoop();
     }
     $data['cbIndex']++;
     $data['callback'] = array($this, __FUNCTION__);
     call_user_func($this->_arrPreRouter[$cbIndex], $dispatcher, $data);
     return AHA_AGAIN;
 }