首页 > 其他 > 详细

Phalcon处理404页面的 Ruter 方法

时间:2014-07-24 10:10:53      阅读:757      评论:0      收藏:0      [点我收藏+]
  /**
     * 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 方法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!