本文整理匯總了PHP中CI_Config::base_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Config::base_url方法的具體用法?PHP CI_Config::base_url怎麽用?PHP CI_Config::base_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CI_Config
的用法示例。
在下文中一共展示了CI_Config::base_url方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
function base_url($uri = '')
{
$url = parent::base_url($uri);
if ($_SERVER['SERVER_PORT'] == 443) {
$url = str_replace('http://', 'https://', $url);
}
return $url;
}
示例2: implode
function base_url($uri = '')
{
if (is_array($uri)) {
$uri = implode('/', $uri);
}
if (function_exists('get_instance')) {
$CI =& get_instance();
$uri = $CI->lang->localized($uri);
}
return parent::base_url($uri);
}
示例3: 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 */