当前位置: 首页>>代码示例>>PHP>>正文


PHP Router::clear方法代码示例

本文整理汇总了PHP中Phalcon\Mvc\Router::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::clear方法的具体用法?PHP Router::clear怎么用?PHP Router::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phalcon\Mvc\Router的用法示例。


在下文中一共展示了Router::clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mvcRouter

 private function mvcRouter()
 {
     //Register routing
     $router = new Router();
     $router->clear();
     foreach ($this->config('route') as $url => $route) {
         $router->add($url, $route->toArray());
     }
     return $router;
 }
开发者ID:serus22,项目名称:phalconz,代码行数:10,代码来源:Bootstrap.php

示例2: __construct

 /**
  * @param Router|null $router
  * @param Url|null $url
  */
 public function __construct(Router $router = null, Url $url = null)
 {
     $di = new DI();
     $di->setShared('request', new PhalconRequest());
     if ($router instanceof PhalconRouterInterface) {
         $this->router = $router;
     } elseif ($router === null) {
         $this->router = new Router();
         $this->router->clear();
     } else {
         throw new Exception\RuntimeException('Router has to be an instance of RouterInterface');
     }
     $this->router->setDI($di);
     $di->setShared('router', $this->router);
     if ($url instanceof UrlInterface) {
         $this->url = $url;
     } elseif ($url === null) {
         $this->url = new Url();
         $this->url->setBaseUri('/');
     } else {
         throw new Exception\RuntimeException('Url has to be an instance of UrlInterface');
     }
     $this->url->setDI($di);
 }
开发者ID:theDisco,项目名称:phalcon-expressive,代码行数:28,代码来源:PhalconRouter.php

示例3: createPhalconRouter

 /**
  * @return Router
  */
 private static function createPhalconRouter()
 {
     $router = new Router();
     $router->clear();
     $router->setDi(new FactoryDefault());
     return $router;
 }
开发者ID:theDisco,项目名称:phalcon-expressive,代码行数:10,代码来源:PhalconRouterTest.php

示例4: tearDown

 public function tearDown()
 {
     $this->router->clear();
     parent::tearDown();
 }
开发者ID:rcmonitor,项目名称:abboom_phalcon_code_example,代码行数:5,代码来源:ApiModuleRouteTest.php

示例5: Router

<?php

use Phalcon\Mvc\Router;
$router = new Router();
$router->clear();
$router->removeExtraSlashes(true);
// Add default route
$router->add("/", array("controller" => "index", "action" => "index"));
// Add 404 route
$router->notFound(array("controller" => "index", "action" => "index"));
// Add route groups
$router->mount(new \Pangea\Routes\AccountRoutes());
$router->mount(new \Pangea\Routes\TownRoutes());
$router->mount(new \Pangea\Routes\RaceRoutes());
return $router;
开发者ID:GGAlanSmithee,项目名称:pangea-api,代码行数:15,代码来源:router.php

示例6: clear

 public function clear()
 {
     parent::clear();
 }
开发者ID:mattvb91,项目名称:cphalcon,代码行数:4,代码来源:Router.php


注:本文中的Phalcon\Mvc\Router::clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。