码迷,mamicode.com
首页 > 其他好文 > 详细

Phalcon处理404页面的 Ruter 方法

时间:2014-07-24 10:10:53      阅读:473      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   for   re   

  /**
     * 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

Phalcon处理404页面的 Ruter 方法

标签:style   blog   color   io   for   re   

原文地址:http://www.cnblogs.com/wanglijun/p/3864731.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!