本文整理匯總了PHP中Bluz\Proxy\Request::setRequestUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::setRequestUri方法的具體用法?PHP Request::setRequestUri怎麽用?PHP Request::setRequestUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bluz\Proxy\Request
的用法示例。
在下文中一共展示了Request::setRequestUri方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testErrorController
/**
* Test run Error Controller
*/
public function testErrorController()
{
// setup Request
Request::setRequestUri(uniqid('module') . '/' . uniqid('controller'));
Request::setMethod(Request::METHOD_GET);
// run Application
$this->getApp()->process();
$this->assertEquals(Router::getErrorModule(), $this->getApp()->getModule());
$this->assertEquals(Router::getErrorController(), $this->getApp()->getController());
}
示例2: dispatchUri
/**
* dispatch URI
*
* @param string $uri in format "module/controllers"
* @param array $params of request
* @param string $method HTTP
* @param bool $ajax
* @return void
*/
protected function dispatchUri($uri, array $params = null, $method = Http\Request::METHOD_GET, $ajax = false)
{
$this->prepareRequest($uri, $params, $method, $ajax);
$uri = trim($uri, '/ ');
list($module, $controller) = explode('/', $uri);
// set default controllers
if (!$controller) {
$controller = Request::getController();
}
Request::setModule($module);
Request::setController($controller);
Request::setRequestUri($uri);
$this->getApp()->process();
}