當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Router::getParams方法代碼示例

本文整理匯總了PHP中Phalcon\Mvc\Router::getParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP Router::getParams方法的具體用法?PHP Router::getParams怎麽用?PHP Router::getParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Phalcon\Mvc\Router的用法示例。


在下文中一共展示了Router::getParams方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUpDispatcher

 private function setUpDispatcher()
 {
     $this->dispatcher->setControllerName($this->router->getControllerName());
     $this->dispatcher->setActionName($this->router->getActionName());
     $this->dispatcher->setParams($this->router->getParams());
     $oDispatcherEventManager = new Manager();
     $oDispatcherEventManager->attach('dispatch:beforeDispatch', function (Event $oEvent, Dispatcher $oDispatcher, $data) {
         return false;
     });
     $this->dispatcher->setEventsManager($oDispatcherEventManager);
 }
開發者ID:rcmonitor,項目名稱:abboom_phalcon_code_example,代碼行數:11,代碼來源:DefaultDispatcherTest.php

示例2: testEasyMatched

 /**
  * @dataProvider easyMatchedProvider
  */
 public function testEasyMatched($strUri, $strController, $strAction, $strRouteName, $arParameters = array())
 {
     $this->router->handle($strUri);
     $boolMatched = $this->router->wasMatched();
     $this->assertTrue($boolMatched, 'route ' . $strUri . ' does not match any of ' . print_r($this->routes, true) . ' when it should');
     $this->assertEquals($strRouteName, $this->router->getMatchedRoute()->getName(), 'matches wrong route');
     $this->assertEquals($strController, $this->router->getControllerName(), 'wrong controller name');
     $this->assertEquals($strAction, $this->router->getActionName(), 'wrong action name');
     $arActualParameters = $this->router->getParams();
     foreach ($arParameters as $key => $value) {
         $this->assertArrayHasKey($key, $arParameters, 'key "' . $key . '" not found');
         $this->assertEquals($arParameters[$key], $arActualParameters[$key], 'parameter "' . $key . '" mismatch');
     }
 }
開發者ID:rcmonitor,項目名稱:abboom_phalcon_code_example,代碼行數:17,代碼來源:RouterMatchesTest.php

示例3: testMatchEasyRoutes

 /**
  * @covers initialize
  *
  *
  * @dataProvider easyMatchRoutesDataProvider
  */
 public function testMatchEasyRoutes($strUri, $strModule, $strController, $strAction, $strRouteName, $arParameters)
 {
     $this->router->handle($strUri);
     $boolMatched = $this->router->wasMatched();
     $this->assertTrue($boolMatched, 'route does not match when it should');
     $this->assertEquals($strRouteName, $this->router->getMatchedRoute()->getName(), 'matched wrong route: ' . $this->router->getMatchedRoute()->getPattern());
     $this->assertEquals($strModule, $this->router->getModuleName(), 'wrong module name');
     $this->assertEquals($strController, $this->router->getControllerName(), 'wrong controller name');
     $this->assertEquals($strAction, $this->router->getActionName(), 'wrong action name');
     $arActualParameters = $this->router->getParams();
     foreach ($arParameters as $key => $value) {
         $this->assertArrayHasKey($key, $arParameters, 'key "' . $key . '" not found');
         $this->assertEquals($arParameters[$key], $arActualParameters[$key], 'parameter "' . $key . '" mismatch');
     }
 }
開發者ID:rcmonitor,項目名稱:abboom_phalcon_code_example,代碼行數:21,代碼來源:ApiModuleRouteTest.php

示例4: routing

 public function routing(Router $router)
 {
     $this->setModuleName($router->getModuleName());
     $this->setNamespaceName($router->getNamespaceName());
     $this->setControllerName($router->getControllerName());
     $this->setActionName($router->getActionName());
     $this->setParams($router->getParams());
 }
開發者ID:nexik,項目名稱:nest-core,代碼行數:8,代碼來源:Dispatcher.php

示例5: getParams

 public function getParams()
 {
     return parent::getParams();
 }
開發者ID:mattvb91,項目名稱:cphalcon,代碼行數:4,代碼來源:Router.php


注:本文中的Phalcon\Mvc\Router::getParams方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。