本文整理汇总了PHP中Router::getPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::getPaths方法的具体用法?PHP Router::getPaths怎么用?PHP Router::getPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Router
的用法示例。
在下文中一共展示了Router::getPaths方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($method, $messages)
{
$this->controller = new AppController();
$params = Router::getParams();
$viewPath = $this->controller->viewPath;
if (Configure::read('App.theme')) {
$viewPath = 'errors';
if ($this->controller->view == 'Theme') {
$viewPath = 'themed' . DS . Configure::read('App.theme') . DS . 'errors';
}
}
if (Configure::read('debug') == 0) {
$method = 'error404';
}
$checkView = VIEWS . $viewPath . DS . Inflector::underscore($method) . '.ctp';
if (file_exists($checkView)) {
$this->controller->_set(Router::getPaths());
$this->controller->viewPath = $viewPath;
$this->controller->theme = $appConfigurations['theme'];
$this->controller->pageTitle = __('Error', true);
$this->controller->set('message', $messages[0]['url']);
$this->controller->set('appConfigurations', $appConfigurations);
$this->controller->render($method);
e($this->controller->output);
} else {
parent::__construct($method, $messages);
}
}
示例2: __construct
/**
* __construct
*
* @access public
* @return void
*/
function __construct() {
parent::__construct();
$this->_set(Router::getPaths());
$this->params = Router::getParams();
$this->constructClasses();
$this->Component->initialize($this);
$this->_set(array('cacheAction' => false, 'viewPath' => 'errors'));
}
示例3: __construct
/**
* __construct
*
* @access public
* @return void
*/
function __construct()
{
parent::__construct();
$this->_set(Router::getPaths());
$this->request = Router::getRequest(false);
$this->constructClasses();
$this->Components->trigger('initialize', array(&$this));
$this->_set(array('cacheAction' => false, 'viewPath' => 'errors'));
}
示例4: __construct
public function __construct($request = null, $response = null)
{
parent::__construct($request, $response);
if ($this->name == 'CakeError') {
$this->_set(Router::getPaths());
$this->request->params = Router::getParams();
$this->constructClasses();
$this->startupProcess();
}
}
示例5: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
Croogo::applyHookProperties('Hook.controller_properties');
parent::__construct();
if ($this->name == 'CakeError') {
$this->_set(Router::getPaths());
$this->params = Router::getParams();
$this->constructClasses();
$this->Component->initialize($this);
$this->beforeFilter();
$this->Component->triggerCallback('startup', $this);
}
}
示例6: __construct
/**
*
*/
function __construct($method, $messages)
{
$params = Router::getParams();
if (($method == 'missingController' || $method == 'missingAction') && file_exists(VIEWS . DS . 'static' . DS . $params['controller'] . ".ctp")) {
$this->controller =& new AppController();
$this->controller->_set(Router::getPaths());
$this->controller->params = $params;
$this->controller->constructClasses();
$this->controller->beforeFilter();
$this->controller->viewPath = 'static';
$this->controller->render($params['controller']);
e($this->controller->output);
exit;
}
parent::__construct($method, $messages);
exit;
}
示例7: normalize
/**
* Normalizes a URL for purposes of comparison. Will strip the base path off
* and replace any double /'s. It will not unify the casing and underscoring
* of the input value.
*
* @param mixed $url URL to normalize Either an array or a string url.
* @return string Normalized URL
* @access public
* @static
*/
function normalize($url = '/')
{
if (is_array($url)) {
$url = Router::url($url);
} elseif (preg_match('/^[a-z\\-]+:\\/\\//', $url)) {
return $url;
}
$paths = Router::getPaths();
if (!empty($paths['base']) && stristr($url, $paths['base'])) {
$url = preg_replace('/^' . preg_quote($paths['base'], '/') . '/', '', $url, 1);
}
$url = '/' . $url;
while (strpos($url, '//') !== false) {
$url = str_replace('//', '/', $url);
}
$url = preg_replace('/(?:(\\/$))/', '', $url);
if (empty($url)) {
return '/';
}
return $url;
}
示例8: normalize
/**
* Normalizes a URL for purposes of comparison
*
* @param mixed $url URL to normalize
* @return string Normalized URL
* @access public
*/
function normalize($url = '/')
{
if (is_array($url)) {
$url = Router::url($url);
}
$paths = Router::getPaths();
if (!empty($paths['base']) && stristr($url, $paths['base'])) {
$url = str_replace($paths['base'], '', $url);
}
$url = '/' . $url;
while (strpos($url, '//') !== false) {
$url = str_replace('//', '/', $url);
}
$url = preg_replace('/(\\/$)/', '', $url);
if (empty($url)) {
return '/';
}
return $url;
}
示例9: _normalizeURL
/**
* Normalizes a URL
*
* @param string $url URL to normalize
* @return string Normalized URL
* @access protected
*/
function _normalizeURL($url = '/')
{
if (is_array($url)) {
$url = Router::url($url);
}
$paths = Router::getPaths();
if (!empty($paths['base']) && stristr($url, $paths['base'])) {
$url = r($paths['base'], '', $url);
}
$url = '/' . $url . '/';
while (strpos($url, '//') !== false) {
$url = r('//', '/', $url);
}
return $url;
}
示例10: missingModel
/**
* Renders the Missing Model class web page.
*
* @param unknown_type $params Parameters for controller
* @access public
*/
function missingModel($params)
{
extract(Router::getPaths());
extract($params, EXTR_OVERWRITE);
$this->controller->base = $base;
$this->controller->viewPath = 'errors';
$this->controller->webroot = $this->_webroot();
$this->controller->set(array('model' => $className, 'title' => __('Missing Model', true)));
$this->controller->render('missingModel');
exit;
}
示例11: urlProjectFull
/**
* Captura a URL do projeto
* - protocol://project_server/project_name
* - http://192.168.56.101/project_name/
* - http://localhost/project_name/
*
* @return string url
*/
public static function urlProjectFull()
{
$urlServer = Router::fullBaseUrl();
$projectServerPath = Router::getPaths();
return $urlServer . $projectServerPath['base'];
}