本文整理汇总了PHP中uri_path函数的典型用法代码示例。如果您正苦于以下问题:PHP uri_path函数的具体用法?PHP uri_path怎么用?PHP uri_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uri_path函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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')));
}
开发者ID:notmaintained,项目名称:oboxapps,代码行数:7,代码来源:apache.adapter.php
示例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);
}
}
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:29,代码来源:Blog_base_controller.php
示例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();
}
}
开发者ID:ressphere,项目名称:cb_iloveproperty,代码行数:33,代码来源:site_docs.php
示例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();
}
}
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:29,代码来源:page_router.php
示例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;
}
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:10,代码来源:user_guide.php
示例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');
}
}
}
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:10,代码来源:Fuel_hooks.php
示例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;
}
}
}
开发者ID:huayuxian,项目名称:FUEL-CMS,代码行数:10,代码来源:Fuel_hooks.php
示例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;
}
}
开发者ID:huayuxian,项目名称:FUEL-CMS,代码行数:11,代码来源:Fuel_pagevars.php
示例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;
}
}
开发者ID:ressphere,项目名称:cb_iloveproperty,代码行数:11,代码来源:Fuel_pagevars.php
示例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);
}
}
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:13,代码来源:Fuel_base_controller.php
示例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);
}
}
开发者ID:ressphere,项目名称:cb_iloveproperty,代码行数:46,代码来源:page_router.php
示例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;
}
开发者ID:ressphere,项目名称:cb_iloveproperty,代码行数:26,代码来源:Fuel_sitevars.php
示例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();
}
}
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:36,代码来源:site_docs.php
示例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);
}
开发者ID:huayuxian,项目名称:FUEL-CMS,代码行数:7,代码来源:MY_url_helper.php
示例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 {
开发者ID:notmaintained,项目名称:oboxapps,代码行数:31,代码来源:uri.lib.php
示例16: _remap
function _remap()
{
$this->current_page = $this->fuel->user_guide->current_page();
$cache_id = $this->current_page;
if ($this->fuel->user_guide->config('use_cache') and $this->fuel->cache->is_cached($cache_id)) {
$output = $this->fuel->cache->get($cache_id);
} else {
$this->fuel->pagevars->vars_path = USER_GUIDE_PATH . 'views/_variables/';
$vars = array();
// get modules
$modules = array('', 'fuel');
$modules = array_merge($modules, $this->fuel->config('modules_allowed'));
$vars = $this->fuel->user_guide->get_vars($this->current_page);
foreach ($modules as $m) {
if ((!$this->fuel->user_guide->config('authenticate') or $this->fuel->auth->has_permission('user_guide_' . $m)) and file_exists(MODULES_PATH . $m . '/views/_docs/index' . EXT)) {
$module_view = $this->load->module_view($m, '_docs/index', array(), TRUE);
$mod_page_title = $this->fuel->user_guide->page_title($module_view);
$vars['modules'][$m] = !empty($mod_page_title) ? $mod_page_title : humanize($m) . ' Module';
}
}
// render page
// pull from modules folder if URI says so
$uri_path_index = count(explode('/', $this->fuel->user_guide->config('root_url'))) + 1;
$module_page = uri_path(FALSE, $uri_path_index);
$module_view_path = !empty($module_page) ? '_docs/' . $module_page : '_docs/index';
$allow_auto_generation = $this->fuel->user_guide->config('allow_auto_generation');
if (is_file(USER_GUIDE_PATH . 'views/' . $this->current_page . EXT)) {
$vars['body'] = $this->load->module_view(USER_GUIDE_FOLDER, $this->current_page, $vars, TRUE);
if ($this->fuel->user_guide->page_segment(2)) {
$vars['sections'] = $this->fuel->user_guide->breadcrumb($this->current_page);
}
} else {
if (is_file(FUEL_PATH . 'views/_docs/' . $this->current_page . EXT)) {
$vars['body'] = $this->load->module_view(FUEL_FOLDER, '_docs/' . $this->current_page, $vars, TRUE);
if ($this->fuel->user_guide->page_segment(2)) {
$vars['sections'] = $this->fuel->user_guide->breadcrumb($this->current_page);
}
} else {
if ($this->fuel->user_guide->page_segment(2)) {
if (in_array($this->fuel->user_guide->page_segment(1), $this->fuel->user_guide->valid_folders)) {
$module = FUEL_FOLDER;
$file = $this->fuel->user_guide->page_segment(2);
$uri_path_index = count(explode('/', $this->fuel->user_guide->config('root_url'))) - 2;
$module_view_path = '_docs/' . uri_path(FALSE, $uri_path_index);
} else {
$module = $this->fuel->user_guide->page_segment(2);
$file = $this->fuel->user_guide->page_segment(3);
if (!empty($file) and $file != 'index') {
$module_view_path = '_docs/' . $file;
}
}
$body = '';
if (file_exists(MODULES_PATH . $module . '/views/' . $module_view_path . EXT)) {
$body = $this->load->module_view($module, $module_view_path, $vars, TRUE);
} else {
if ($allow_auto_generation === TRUE or in_array($module, $allow_auto_generation)) {
if (!empty($file)) {
$uri_folder = $this->fuel->user_guide->page_segment(4);
$valid_folders = $this->fuel->user_guide->valid_folders;
$file_name = ucfirst($file);
$folder = ($uri_folder and in_array($uri_folder, $valid_folders)) ? $uri_folder : 'libraries';
if (preg_match('#_helper$#', $file)) {
$folder = 'helpers';
$file_name = strtolower($file);
} else {
if (preg_match('#_model$#', $file)) {
$folder = 'models';
$file_name = strtolower($file);
}
}
$file_name = preg_replace('#^my_(\\w+)#', 'MY_$1', $file_name);
$file_path = MODULES_PATH . $module . '/' . $folder . '/' . $file_name . EXT;
if (file_exists($file_path)) {
$body = $this->fuel->user_guide->generate_docs($file_name, $folder, $module, array());
} else {
$file_path = APPPATH . '/' . $folder . '/' . $file_name . EXT;
if (file_exists($file_path)) {
$body = $this->fuel->user_guide->generate_docs($file_name, $folder, $module, array());
}
}
if ($this->fuel->user_guide->page_segment(2)) {
$vars['sections'] = $this->fuel->user_guide->breadcrumb($this->current_page);
}
}
}
}
if (!$this->fuel->user_guide->config('authenticate') or $this->fuel->auth->has_permission('user_guide_' . $module) and isset($body)) {
$vars['body'] = $body;
if ($file) {
if (isset($vars['modules'][$module])) {
if ($module != FUEL_FOLDER) {
$vars['sections'] = array($vars['modules'][$module] => 'modules/' . $module);
}
} else {
redirect_404();
}
}
}
} else {
redirect_404();
//.........这里部分代码省略.........
开发者ID:rudyondolan,项目名称:FUEL-CMS-User-Guide-Module,代码行数:101,代码来源:user_guide.php
示例17: toolbar
/**
* Returns the inline editing toolbar HTML
*
* @access public
* @return void
*/
public function toolbar()
{
$user_lang = $this->fuel->auth->user_lang();
$this->fuel->load_language('fuel_inline_edit', $user_lang);
$this->fuel->load_language('fuel_js', $user_lang);
$vars['page'] = $this->fuel->page->properties();
$vars['layouts'] = $this->fuel->layouts->options_list();
$vars['language'] = $this->fuel->language->detect();
$vars['language_mode'] = $this->fuel->language->mode();
$vars['language_default'] = $this->fuel->language->default_option();
$vars['tools'] = $this->toolbar_tools();
$vars['js_localized'] = json_lang('fuel/fuel_js', $user_lang);
$vars['is_fuelified'] = is_fuelified();
$vars['can_edit_pages'] = $this->CI->fuel->auth->has_permission('pages', 'edit');
if ($this->fuel->pages->mode() == 'views') {
$vars['others'] = array();
} else {
$location = uri_path();
$this->CI->load->module_model(FUEL_FOLDER, 'fuel_pages_model');
$vars['others'] = $this->CI->fuel_pages_model->get_others('location', $location, 'location');
}
$vars['init_params']['pageId'] = !empty($vars['page']['id']) ? $vars['page']['id'] : 0;
$vars['init_params']['pageLocation'] = !empty($vars['page']['location']) ? $vars['page']['location'] : uri_path();
$vars['init_params']['basePath'] = WEB_PATH;
$vars['init_params']['cookiePath'] = $this->CI->fuel->config('fuel_cookie_path');
$vars['init_params']['imgPath'] = img_path('', 'fuel');
$vars['init_params']['cssPath'] = css_path('', 'fuel');
$vars['init_params']['jsPath'] = js_path('', 'fuel');
$vars['init_params']['editor'] = $this->fuel->config('text_editor');
$vars['init_params']['editorConfig'] = $this->fuel->config('ck_editor_settings');
$last_page = uri_path();
if (empty($last_page)) {
$last_page = $this->fuel->config('default_home_view');
}
$vars['last_page'] = uri_safe_encode($last_page);
$output = $this->CI->load->module_view(FUEL_FOLDER, '_blocks/inline_edit_bar', $vars, TRUE);
return $output;
}
开发者ID:kbjohnson90,项目名称:FUEL-CMS,代码行数:44,代码来源:Fuel_admin.php
示例18: __construct
function __construct()
{
$this->_CI =& get_instance();
$this->location = uri_path();
}
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:5,代码来源:Fuel_pagevars.php
示例19: init_page
/**
* Initializes the user guide page
*
* @access public
* @return void
*/
function init_page()
{
$uri = uri_path(FALSE);
$root_url = $this->config('root_url');
if (substr($root_url, -1) == '/') {
$root_url = trim(substr($root_url, 0, strlen($root_url) - 1), '/');
}
$new_uri = preg_replace('#^' . $root_url . '#', '', trim($uri, '/'));
if (empty($new_uri)) {
$new_uri = 'home';
}
$this->set_current_page($new_uri);
}
开发者ID:rudyondolan,项目名称:FUEL-CMS-User-Guide-Module,代码行数:19,代码来源:Fuel_user_guide.php
示例20: get_max_page_param
/**
* Returns the maximum number of page parameters associated with the current page
*
* @access public
* @return int
*/
public function get_max_page_param()
{
static $max_page_params;
// determine max page params
if (is_null($max_page_params)) {
$max_page_params = 0;
}
if (is_array($this->fuel->config('max_page_params'))) {
//$location = implode('/', $this->CI->uri->rsegment_array());
$location = uri_path();
// use this function instead so it will remove any language parameters
foreach ($this->fuel->config('max_page_params') as $key => $val) {
// add any match to the end of the key in case it doesn't exist (no problems if it already does)'
$key .= ':any';
// convert wild-cards to RegEx
$key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
// does the RegEx match?
if (preg_match('#^' . $key . '$#', $location)) {
$max_page_params = $val;
break;
}
}
} else {
$max_page_params = (int) $this->fuel->config('max_page_params');
}
return $max_page_params;
}
开发者ID:prgoncalves,项目名称:Beatcrumb-web,代码行数:33,代码来源:Fuel_pages.php
注:本文中的uri_path函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论