本文整理汇总了PHP中uri_path函数的典型用法代码示例。如果您正苦于以下问题:PHP uri_path函数的具体用法?PHP uri_path怎么用?PHP uri_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uri_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apache_specific_request_path
function apache_specific_request_path()
{
if (!apache_specific_is_rewrite_engine_on()) {
return default_request_path();
}
return _apache_specific_request_path(server_var('REQUEST_URI'), uri_path(server_var('PHP_SELF')));
}
示例2: _render
function _render($view, $vars = array(), $return = FALSE, $layout = '')
{
if (empty($layout)) {
$layout = '_layouts/' . $this->fuel_blog->layout();
}
$this->load->module_library(FUEL_FOLDER, 'fuel_pagevars');
// get any global variables for the headers and footers
$_vars = $this->fuel_pagevars->retrieve(uri_path());
if (is_array($_vars)) {
$vars = array_merge($_vars, $vars);
}
$view_folder = $this->fuel_blog->theme_path();
$vars['CI'] =& get_instance();
if (!empty($layout)) {
$vars['body'] = $this->load->module_view($this->fuel_blog->settings('theme_module'), $view_folder . $view, $vars, TRUE);
$view = $this->fuel_blog->theme_path() . $this->fuel_blog->layout();
} else {
$view = $view_folder . $view;
}
$output = $this->load->module_view($this->fuel_blog->settings('theme_module'), $view, $vars, TRUE);
$this->load->module_library(FUEL_FOLDER, 'fuel_page');
$this->fuel_page->initialize();
$output = $this->fuel_page->fuelify($output);
if ($return) {
return $output;
} else {
$this->output->set_output($output);
}
}
示例3: _remap
public function _remap()
{
if ($this->fuel->modules->exists('user_guide') and defined('USER_GUIDE_FOLDER')) {
$this->load->helper(USER_GUIDE_FOLDER, 'user_guide');
}
$this->load->helper('text');
$page = uri_path(TRUE, 1);
if (empty($page)) {
$page = 'index';
}
$this->fuel->pagevars->vars_path = APPPATH . 'views/_variables/';
$this->fuel->pagevars->location = $page;
$vars = $this->fuel->pagevars->view('site_docs');
$vars['body'] = 'index';
// render page
if (file_exists(APPPATH . '/views/_docs/' . $page . '.php')) {
// use app module which is the application directory
$vars['body'] = $this->load->module_view('app', '_docs/' . $page, $vars, TRUE);
// get layout page
if (file_exists(APPPATH . 'views/_layouts/documentation.php')) {
$this->load->module_view(NULL, '_layouts/documentation', $vars);
} else {
if (file_exists(FUEL_PATH . 'views/_layouts/documentation' . EXT)) {
$vars['page_title'] = $this->config->item('site_name', 'fuel');
$this->load->view('_layouts/documentation', $vars);
} else {
$this->output->set_output($vars['body']);
}
}
} else {
show_404();
}
}
示例4: _remap
function _remap($method)
{
$this->location = uri_path(TRUE);
// if the rerouted file can't be found, look for the non-routed file'
if (!file_exists(APPPATH . 'views/' . $this->location . EXT)) {
$this->location = uri_path(FALSE);
}
if (empty($this->location)) {
$this->location = $this->config->item('default_home_view', 'fuel');
}
$this->load->module_library(FUEL_FOLDER, 'fuel_page');
$config = array();
$config['location'] = $this->location;
if ($this->config->item('fuel_mode', 'fuel') == 'views') {
$config['render_mode'] = 'views';
$this->fuel_page->initialize($config);
$this->_remap_variables($method);
} else {
if ($this->config->item('fuel_mode', 'fuel') != 'cms') {
$config['render_mode'] = 'auto';
$this->fuel_page->initialize($config);
if (!$this->fuel_page->has_cms_data()) {
$this->_remap_variables();
return;
}
}
$this->_remap_cms();
}
}
示例5: _get_page
function _get_page()
{
$uri = uri_path(FALSE);
$root_url = $this->config->item('user_guide_root_url');
if (substr($root_url, -1) == '/') {
$root_url = substr($root_url, 0, strlen($root_url) - 1);
}
$new_uri = preg_replace('#^' . $root_url . '#', '', $uri);
return $new_uri;
}
示例6: dev_password
function dev_password()
{
$CI =& get_instance();
if ($CI->config->item('dev_password', 'fuel') and !$CI->fuel_auth->is_logged_in() and !preg_match('#^' . fuel_uri('login') . '#', uri_path(FALSE))) {
$CI->load->library('session');
if (!$CI->session->userdata('dev_password')) {
redirect('fuel/login/dev');
}
}
}
示例7: offline
public function offline()
{
if (!USE_FUEL_ROUTES) {
$CI =& get_instance();
if ($CI->fuel->config('offline') and !$CI->fuel->auth->is_logged_in() and !preg_match('#^' . fuel_uri('login') . '#', uri_path(FALSE))) {
echo $CI->fuel->pages->render('offline', array(), array(), TRUE);
exit;
}
}
}
示例8: initialize
public function initialize($params = array())
{
parent::initialize($params);
if (empty($this->location)) {
$this->location = uri_path();
}
$default_home = $this->fuel->config('default_home_view');
if (empty($this->location) or $this->location == $this->CI->router->routes['404_override']) {
$this->location = $default_home;
}
}
示例9: initialize
public function initialize($params)
{
parent::initialize($params);
if (empty($this->location)) {
$this->location = uri_path();
}
$default_home = $this->fuel->config('default_home_view');
if (empty($this->location) or $this->location == 'page_router') {
$this->location = $default_home;
}
}
示例10: _last_page
protected function _last_page($key = NULL)
{
if (!isset($key)) {
$key = uri_path(FALSE);
}
$invalid = array(fuel_uri('recent'));
$session_key = $this->fuel_auth->get_session_namespace();
$user_data = $this->fuel_auth->user_data();
if (!is_ajax() and empty($_POST) and !in_array($key, $invalid)) {
$user_data['last_page'] = $key;
$this->session->set_userdata($session_key, $user_data);
}
}
示例11: _remap
public function _remap($method)
{
$this->location = uri_path(TRUE);
// if the rerouted file can't be found, look for the non-routed file'
if (!file_exists(APPPATH . 'views/' . $this->location . EXT)) {
$non_routed_uri = uri_path(FALSE);
if (file_exists(APPPATH . 'views/' . $non_routed_uri . EXT)) {
$this->location = $non_routed_uri;
}
unset($non_routed_uri);
}
if (empty($this->location)) {
$this->location = $this->fuel->config('default_home_view');
}
$config = array();
$config['location'] = $this->location;
if ($this->fuel->pages->mode() == 'views') {
$config['render_mode'] = 'views';
$page = $this->fuel->pages->create($config);
$this->_remap_variables($page);
} else {
if ($this->fuel->pages->mode() != 'cms') {
$config['render_mode'] = 'auto';
if ($this->fuel->config('uri_view_overwrites')) {
// loop through the pages array looking for wild-cards
foreach ($this->fuel->config('uri_view_overwrites') as $val) {
// convert wild-cards to RegEx
$key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $val));
// does the RegEx match?
if (preg_match('#^' . $val . '$#', $config['location'])) {
$config['render_mode'] = 'views';
}
}
}
$page = $this->fuel->pages->create($config);
if (!$page->has_cms_data() and $config['render_mode'] == 'auto' or $config['render_mode'] == 'views') {
$this->_remap_variables($page);
return;
}
} else {
$config['render_mode'] = 'cms';
$page = $this->fuel->pages->create($config);
}
$this->_remap_cms($page);
}
}
示例12: get
/**
* Returns an array of site variables pertaining to a given URI path
*
* @access public
* @param string A URI path. If left blank, the current URI path will be used (optional)
* @return array
*/
public function get($location = NULL)
{
if (is_null($location)) {
$location = uri_path();
}
$this->fuel->load_model('fuel_sitevariables');
$site_vars = $this->CI->fuel_sitevariables_model->find_all_array(array('active' => 'yes'));
$vars = array();
// Loop through the pages array looking for wild-cards
foreach ($site_vars as $site_var) {
// Convert wild-cards to RegEx
$key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $site_var['scope']));
// Does the RegEx match?
if (empty($key) or preg_match('#^' . $key . '$#', $location)) {
$vars[$site_var['name']] = $site_var['value'];
}
}
return $vars;
}
示例13: _remap
function _remap()
{
$this->load->module_library(FUEL_FOLDER, 'fuel_pagevars');
if ($this->_has_module('user_guide')) {
$this->load->helper(USER_GUIDE_FOLDER, 'user_guide');
}
$this->load->helper('text');
$page = uri_path(TRUE, 1);
if (empty($page)) {
$page = 'index';
}
$this->fuel_pagevars->vars_path = APPPATH . 'views/_variables/';
$vars = $this->fuel_pagevars->view_variables($page, 'site_docs');
$vars['body'] = 'index';
// render page
if (file_exists(APPPATH . '/views/_docs/' . $page . '.php')) {
// HACK to get it to go to the application directory set the _directories array to empty
$matchbox_dirs = $this->matchbox->_directories;
$this->matchbox->_directories = array();
$vars['body'] = $this->load->view('_docs/' . $page, $vars, TRUE);
// get layout page
if (file_exists(APPPATH . 'views/_layouts/documentation.php')) {
$this->load->module_view(NULL, '_layouts/documentation', $vars);
} else {
if ($this->_has_module('user_guide')) {
$this->matchbox->_directories = $matchbox_dirs;
$vars['page_title'] = $this->config->item('site_name', 'fuel');
$this->load->view('_layouts/documentation', $vars);
} else {
$this->output->set_output($vars['body']);
}
}
} else {
show_404();
}
}
示例14: is_home
function is_home()
{
$uri_path = uri_path(FALSE);
$CI =& get_instance();
$segs = explode('/', $CI->router->routes['404_override']);
return $uri_path == 'home' or $uri_path == '' or $uri_path == end($segs);
}
示例15: requires
*
* Bombay is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* To read the license please visit http://www.gnu.org/copyleft/gpl.html
*
*
*-------10--------20--------30--------40--------50--------60---------72
*/
requires('helpers', 'webserver');
define('URI_SCHEME', uri_scheme(server_var('HTTPS')));
define('URI_HOST', uri_host(server_var('HTTP_HOST')));
define('URI_PORT', uri_port(server_var('HTTP_HOST')));
define('URI_PATH', uri_path(server_var('PHP_SELF')));
define('URI_ABSOLUTE_BASE', uri_absolute_base(URI_SCHEME, URI_HOST, URI_PORT, URI_PATH));
define('URI_RELATIVE_BASE', uri_relative_base(URI_PATH));
define('URI_SECURE_ABSOLUTE_BASE', uri_absolute_base('https', URI_HOST, URI_PORT, URI_PATH));
function uri_scheme($https)
{
$ssl = !is_null($https) and is_equal('on', $https);
$scheme = $ssl ? 'https' : 'http';
return $scheme;
}
function uri_host($http_host)
{
$pieces = explode(':', $http_host);
if (str_contains(':', $http_host)) {
$host = array_shift($pieces);
} else {