/** * Initializes the router * * @param array $options */ protected function initRouter($options = array()) { $config = $this->di[‘config‘]; $this->di[‘router‘] = function () use ($config) { $router = new PhRouter(false); $router->notFound( array( "controller" => "index", "action" => "notFound", ) ); $router->removeExtraSlashes(true); foreach ($config[‘routes‘] as $route => $items) { $router->add($route, $items->params->toArray()) ->setName($items->name); } return $router; }; }
Phalcon处理404页面的 Ruter 方法,布布扣,bubuko.com
时间: 2024-10-05 08:58:15