本文整理汇总了PHP中Routes::rewrite方法的典型用法代码示例。如果您正苦于以下问题:PHP Routes::rewrite方法的具体用法?PHP Routes::rewrite怎么用?PHP Routes::rewrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Routes
的用法示例。
在下文中一共展示了Routes::rewrite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _build_get_enviroment
private function _build_get_enviroment()
{
$data = self::_http_get_request();
if (isset(APP::$allow_pretty_url) and APP::$allow_pretty_url == false) {
// ELIMINA POSIBLE DUPLICIDAD DE ORIGENES.
if (isset($data['request'])) {
$this->go_to($data['request']);
}
// ESTABLCE ÚNICAMENTE LO CONTENIDO EN $r
if (!empty($data['r'])) {
$data['request'] = $data['r'];
unset($data['r']);
} else {
$data['request'] = null;
}
} elseif (isset(APP::$allow_pretty_url) and APP::$allow_pretty_url == true) {
if (isset($data['r'])) {
$this->go_to($data['r']);
}
}
$routing = Routes::rewrite($data);
self::$context = Routes::$context;
// CARGA CONTEXTO
self::$language = Routes::$language;
// CARGA LENGAUES
if (!is_array($routing)) {
return true;
}
foreach ($routing as $varname => $val) {
$this->{$varname} = $val;
}
// REQUEST ASSIGNMENT
$this->request = $routing['request'];
self::$request_proccessed = $routing['request'];
// FULL ARRAY CONFIG
self::$request_full_array = array('context' => self::$context, 'lang' => isset(self::$language['prefix']) ? self::$language['prefix'] : null, 'controller' => $this->controller, 'action' => $this->action, 'getAttrs' => isset($routing['getAttrs']) ? $routing['getAttrs'] : array());
return true;
}