本文整理汇总了PHP中Mapper::parse方法的典型用法代码示例。如果您正苦于以下问题:PHP Mapper::parse方法的具体用法?PHP Mapper::parse怎么用?PHP Mapper::parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::parse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: normalize
protected static function normalize($request)
{
if (is_null($request)) {
$request = Mapper::parse();
}
$request['controller'] = Inflector::hyphenToUnderscore($request['controller']);
$request['action'] = Inflector::hyphenToUnderscore($request['action']);
return $request;
}
示例2: dispatch
/**
* Chama o controller e a action solicitadas pela URL.
*
* @return mixed Instância do novo controller ou falso em caso de erro
*/
public function dispatch()
{
$path = Mapper::parse();
$path["controller"] = Inflector::hyphenToUnderscore($path["controller"]);
$path["action"] = Inflector::hyphenToUnderscore($path["action"]);
$controller_name = Inflector::camelize($path["controller"]) . "Controller";
if ($controller =& ClassRegistry::load($controller_name, "Controller")) {
if (!can_call_method($controller, $path['action']) && !App::path("View", "{$path['controller']}/{$path['action']}.{$path['extension']}")) {
$this->error("missingAction", array("controller" => $path["controller"], "action" => $path["action"]));
return false;
}
} else {
if (App::path("View", "{$path['controller']}/{$path['action']}.{$path['extension']}")) {
$controller =& ClassRegistry::load("AppController", "Controller");
} else {
$this->error("missingController", array("controller" => $path["controller"]));
return false;
}
}
$controller->params = $path;
$controller->componentEvent("initialize");
$controller->beforeFilter();
$controller->componentEvent("startup");
if (in_array($path["action"], $controller->methods) && can_call_method($controller, $path["action"])) {
$params = $path["params"];
if (!is_null($path["id"])) {
$params = array_merge(array($path["id"]), $params);
}
call_user_func_array(array(&$controller, $path["action"]), $params);
}
if ($controller->autoRender) {
$controller->render();
}
$controller->componentEvent("shutdown");
echo $controller->output;
$controller->afterFilter();
return $controller;
}
示例3: urlParams
/**
* Define os parâmetros da url
*
* @return void
*/
private function urlParams()
{
$this->urlParams = Mapper::parse();
}
示例4: __construct
/**
* Construtor
*/
public function __construct()
{
$params = Mapper::parse();
if ($params['prefix'] == $this->privatePrefix) {
$this->isPrivate = true;
}
}