当前位置: 首页>>代码示例>>PHP>>正文


PHP CI_Config::site_url方法代码示例

本文整理汇总了PHP中CI_Config::site_url方法的典型用法代码示例。如果您正苦于以下问题:PHP CI_Config::site_url方法的具体用法?PHP CI_Config::site_url怎么用?PHP CI_Config::site_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CI_Config的用法示例。


在下文中一共展示了CI_Config::site_url方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: site_url

 public function site_url($uri = '', $force_secure = FALSE)
 {
     //	Prepare the URI as normal
     $_uri = parent::site_url($uri);
     // --------------------------------------------------------------------------
     //	If forcing secure just return now
     if ($force_secure) {
         return preg_replace('#^' . BASE_URL . '#', SECURE_BASE_URL, $_uri);
     }
     // --------------------------------------------------------------------------
     //	If SSL routing is enabled then parse the URL
     if (APP_SSL_ROUTING) {
         $_prefix = 'https://';
         $this->load('routes_ssl');
         // --------------------------------------------------------------------------
         //	Fetch SSL routes
         if (!$this->routes_ssl) {
             $this->routes_ssl = $this->item('routes_ssl');
             if (!$this->routes_ssl) {
                 $this->routes_ssl = array();
             }
         }
         // --------------------------------------------------------------------------
         //	Analyse target URL, if it matches a route then change it to be an https URL
         $_is_secure_route = FALSE;
         foreach ($this->routes_ssl as $route) {
             //	Swap out the pseudo regex's
             $route = str_replace(':any', '.*', $route);
             $route = str_replace(':num', '[0-9]*', $route);
             //	See if any of the routes match, if they do halt the loop.
             //	We need to do an optional prefix for the hosts
             if (BASE_URL !== SECURE_BASE_URL) {
                 $_pattern = '#^(' . preg_quote(BASE_URL, '#') . '|' . preg_quote(SECURE_BASE_URL, '#') . ')?' . $route . '#';
             } else {
                 $_pattern = '#^(' . preg_quote(BASE_URL, '#') . ')?' . $route . '#';
             }
             if (preg_match($_pattern, $_uri)) {
                 $_is_secure_route = TRUE;
                 break;
             }
         }
         // --------------------------------------------------------------------------
         //	If there was a match replace http:// with https://; also replace any
         //	calls for anything to the assets folder or the favicon (so secure content
         //	is shown).
         //	HTTPS is considered on if the domain matches that given in SECURE_BASE_URL
         //	or if the page is being served through HTTPS
         if (isset($_SERVER)) {
             $_page_is_secure = page_is_secure();
             if ($_is_secure_route || $_page_is_secure && preg_match('#^' . BASE_URL . 'assets.*#', $_uri) || $_page_is_secure && preg_match('#^' . NAILS_ASSETS_URL . '.*#', $_uri) || $_page_is_secure && preg_match('#^' . BASE_URL . 'favicon\\.ico#', $_uri)) {
                 //	SSL is off and there was a match, turn SSL on
                 $_uri = preg_replace('#^' . BASE_URL . '#', SECURE_BASE_URL, $_uri);
             }
         }
     }
     // --------------------------------------------------------------------------
     //	Spit back our result
     return $_uri;
 }
开发者ID:nailsapp,项目名称:common,代码行数:59,代码来源:Config.php

示例2:

 function site_url($uri = '')
 {
     $url = parent::site_url($uri);
     if ($_SERVER['SERVER_PORT'] == 443) {
         $url = str_replace('http://', 'https://', $url);
     }
     return $url;
 }
开发者ID:hqlulu,项目名称:startbbs,代码行数:8,代码来源:MY_Config.php

示例3: implode

 function site_url($uri = '')
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $uri = get_instance()->lang->localized($uri);
     }
     return parent::site_url($uri);
 }
开发者ID:Razican,项目名称:MegaPublik,代码行数:10,代码来源:MP_Config.php

示例4: site_url

 public function site_url($uri = '', $protocol = NULL)
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (function_exists('get_instance')) {
         $uri = get_instance()->lang->localized($uri);
     }
     return parent::site_url($uri, $protocol);
 }
开发者ID:orcun-yuksel,项目名称:DMC,代码行数:10,代码来源:MY_Config.php

示例5: implode

 function site_url($uri = '')
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (function_exists('get_instance')) {
         $CI =& get_instance();
         $uri = $CI->lang->localized($uri);
     }
     return parent::site_url($uri);
 }
开发者ID:pjmoore92,项目名称:teamo-webtranslator,代码行数:11,代码来源:MY_Config.php

示例6: implode

 function site_url($uri = '', $protocol = NULL)
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $CI =& get_instance();
         $uri = $CI->lang->localized($uri);
     }
     return parent::site_url($uri);
 }
开发者ID:sidecia,项目名称:wiyoitrip,代码行数:11,代码来源:MY_Config.php

示例7: site_url

 /**
  * @param string $uri
  * @param null $protocol
  * @return string
  */
 public function site_url($uri = '', $protocol = NULL)
 {
     global $LANG;
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $uri = $LANG->localized($uri);
     }
     return parent::site_url($uri);
 }
开发者ID:lalcebo,项目名称:codeigniter-skeleton,代码行数:16,代码来源:MY_Config.php

示例8: site_url

 /**
  * Site URL
  * Returns base_url . index_page [. uri_string]
  *
  * @param	mixed	the URI string or an array of segments
  * @return	string
  */
 public function site_url($uri = '')
 {
     //get ci instance
     $ci = get_instance();
     //check whether sef service is installed
     if ($ci->service->is_installed('sef')) {
         //get service
         $sef = $ci->service->get_service('sef');
         //process the search friendly url
         return $sef->site_url($uri);
     } else {
         return parent::site_url($uri);
     }
 }
开发者ID:colonia,项目名称:tomatocart-v2,代码行数:21,代码来源:TOC_Config.php

示例9: implode

 function site_url($uri = '')
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $CI =& get_instance();
         //echo parent::site_url(); exit;
         //--------------------if($CI->config->item('language') == 'english') return parent::site_url($uri);
         $uri = $CI->lang->localized($uri);
         //echo $uri; exit;
     }
     //echo $uri; exit;
     $site_url = parent::site_url($uri);
     $site_url = rtrim($site_url, '/');
     $site_url .= "/";
     return $site_url;
 }
开发者ID:ponchov,项目名称:quizzworld,代码行数:18,代码来源:MY_Config.php

示例10: real_site_url

 public function real_site_url($uri)
 {
     return self::url_trim(parent::site_url($uri));
 }
开发者ID:JeffaCubed,项目名称:OpenVBX,代码行数:4,代码来源:MY_Config.php

示例11: fopen

 | always be used to set the mode correctly.
 |
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
/*
 |--------------------------------------------------------------------------
 | File Stream Modes
 |--------------------------------------------------------------------------
 |
 | These modes are used when working with fopen()/popen()
 |
*/
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb');
// truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b');
// truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
require FCPATH . "system/core/Config.php";
$url = new CI_Config();
define("BASEURL", $url->base_url());
define("SITEURL", $url->site_url());
/* End of file constants.php */
/* Location: ./application/config/constants.php */
开发者ID:pravinhirmukhe,项目名称:punelic,代码行数:31,代码来源:constants.php

示例12: real_site_url

 public function real_site_url($uri)
 {
     return parent::site_url($uri);
 }
开发者ID:benrasmusen,项目名称:OpenVBX,代码行数:4,代码来源:MY_Config.php


注:本文中的CI_Config::site_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。