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


PHP Router::get方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}');
     $this->subject = new Simple(array('request' => new Request(array('base' => '', 'env' => array('HTTP_HOST' => 'foo.local')))));
 }
开发者ID:EHER,项目名称:monopolis,代码行数:7,代码来源:RendererTest.php

示例2: _saveCtrlContext

 protected function _saveCtrlContext()
 {
     $this->_context['scope'] = Router::scope(false);
     $this->_context['routes'] = Router::get();
     $this->_context['scopes'] = Router::attached();
     Router::reset();
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:7,代码来源:Controller.php

示例3: setUp

 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}');
     $this->subject = new Simple();
 }
开发者ID:EHER,项目名称:chegamos,代码行数:7,代码来源:RendererTest.php

示例4: setUp

 /**
  * Initialize test by creating a new object instance with a default context.
  */
 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}/{:id}.{:type}');
     Router::connect('/{:controller}/{:action}.{:type}');
     $this->context = new MockRenderer(array('request' => new Request(array('base' => '', 'env' => array('HTTP_HOST' => 'foo.local'))), 'response' => new Response()));
     $this->html = new Html(array('context' => &$this->context));
 }
开发者ID:nilamdoc,项目名称:KYCGlobal,代码行数:12,代码来源:HtmlTest.php

示例5: setUp

 /**
  * Initialize test by creating a new object instance with a default context.
  *
  * @return void
  */
 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}/{:id}.{:type}');
     Router::connect('/{:controller}/{:action}.{:type}');
     $this->context = new MockHtmlRenderer();
     $this->html = new Html(array('context' => &$this->context));
 }
开发者ID:EHER,项目名称:chegamos,代码行数:14,代码来源:HtmlTest.php

示例6: setUp

 /**
  * Initialize test by creating a new object instance with a default context.
  */
 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/test', 'Test::index');
     Router::connect('/test2', 'TestTwo::index');
     $this->context = new MockRenderer(array('request' => new Request(array('url' => '/test', 'env' => array('HTTP_HOST' => 'foo.local'))), 'response' => new Response()));
     $this->backend = new Backend(array('context' => &$this->context));
 }
开发者ID:djordje,项目名称:li3_backend,代码行数:12,代码来源:BackendTest.php

示例7: setUp

 /**
  * Initialize test by creating a new object instance with a default context.
  *
  * @return void
  */
 public function setUp()
 {
     $this->_routes = Router::get();
     Router::connect(null);
     Router::connect('/{:controller}/{:action}/{:id}.{:type}', array('id' => null));
     Router::connect('/{:controller}/{:action}');
     $this->context = new MockFormRenderer();
     $this->form = new Form(array('context' => $this->context));
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:14,代码来源:FormTest.php

示例8: all

 /**
  * Lists all connected routes to the router. This is a convenience
  * alias for the `show()` method.
  *
  * Example:
  * {{{
  * li3 route
  * li3 route all
  * }}}
  *
  * Will return an output similar to:
  *
  * {{{
  * Template                        	Params
  * --------                        	------
  * /                               	{"controller":"pages","action":"view"}
  * /pages/{:args}                  	{"controller":"pages","action":"view"}
  * /{:slug:[\w\-]+}                	{"controller":"posts","action":"show"}
  * /{:controller}/{:action}/{:args}	{"action":"index"}
  * }}}
  *
  * @return void
  */
 public function all()
 {
     $routes = Router::get();
     $columns = array(array('Template', 'Params'), array('--------', '------'));
     foreach ($routes as $route) {
         $info = $route->export();
         $columns[] = array($info['template'], json_encode($info['params']));
     }
     $this->columns($columns);
 }
开发者ID:WarToaster,项目名称:HangOn,代码行数:33,代码来源:Route.php

示例9: setUp

 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}/page/{:page:[0-9]+}');
     $request = new Request();
     $request->params = array('controller' => 'posts', 'action' => 'index');
     $request->persist = array('controller');
     $this->context = new MockRenderer(compact('request'));
     $this->pagination = new Pagination(array('context' => $this->context));
 }
开发者ID:thedisco,项目名称:li3_pagination,代码行数:11,代码来源:PaginationTest.php

示例10: setUp

 /**
  * Initialize test by creating a new object instance with a default context.
  */
 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}/{:id}.{:type}', array('id' => null));
     Router::connect('/{:controller}/{:action}/{:args}');
     $request = new Request();
     $request->params = array('controller' => 'posts', 'action' => 'index');
     $request->persist = array('controller');
     $this->context = new MockFormRenderer(compact('request'));
     $this->form = new Form(array('context' => $this->context));
     $this->base = $this->context->request()->env('base') . '/';
 }
开发者ID:newmight2015,项目名称:Blockchain-2,代码行数:16,代码来源:FormTest.php

示例11: setup

 function setup()
 {
     // Route
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}/{:id}.{:type}');
     Router::connect('/{:controller}/{:action}.{:type}');
     // Info
     $this->account = sprintf('UA-%05d-X', rand(1, 99999));
     // Tracking
     Trackers::add('test', array('account' => $this->account, 'adapter' => 'GoogleAnalytics'));
     // Context
     $this->context = new MockHtmlRenderer(array('request' => new Request(array('base' => '', 'env' => array('HTTP_HOST' => 'foo.local'))), 'response' => new Response()));
     // Analytics
     $this->analytics = new Analytics(array('context' => &$this->context));
 }
开发者ID:joseym,项目名称:li3_analytics,代码行数:16,代码来源:AnalyticsTest.php

示例12: testRouteLoading

 /**
  * Test if the routes.php file is loaded correctly and the
  * routes are connected to the router.
  */
 public function testRouteLoading()
 {
     $this->assertEmpty(Router::get(null, true));
     $command = new Route(array('routes' => $this->_config['routes']));
     $this->assertCount(4, Router::get(null, true));
     Router::reset();
     $request = new Request();
     $request->params['env'] = 'production';
     $command = new Route(compact('request') + array('routes' => $this->_config['routes']));
     $this->assertCount(2, Router::get(null, true));
 }
开发者ID:unionofrad,项目名称:lithium,代码行数:15,代码来源:RouteTest.php

示例13: testRouteLoading

 /**
  * Test if the routes.php file is loaded correctly and the
  * routes are connected to the router.
  */
 public function testRouteLoading()
 {
     $this->assertFalse(Router::get());
     $command = new Route(array('routes' => $this->_config['routes']));
     $this->assertEqual(4, count(Router::get()));
     Router::reset();
     $request = new Request();
     $request->params['env'] = 'production';
     $command = new Route(compact('request') + array('routes' => $this->_config['routes']));
     $this->assertEqual(2, count(Router::get()));
 }
开发者ID:newmight2015,项目名称:Blockchain-2,代码行数:15,代码来源:RouteTest.php

示例14: setUp

 public function setUp()
 {
     $this->_routes = Router::get();
     Router::reset();
 }
开发者ID:nashadalam,项目名称:lithium,代码行数:5,代码来源:DispatcherTest.php

示例15: setDefaultRoute

 public function setDefaultRoute()
 {
     $this->_routes = Router::get();
     Router::reset();
     Router::connect('/{:controller}/{:action}');
 }
开发者ID:globus40000,项目名称:li3_mailer,代码行数:6,代码来源:FileTest.php


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