$globals=dirname(__FILE__).'/protected/config/globals.php'; ... require_once($yii); require_once($globals);
/**
* This is the shortcut to DIRECTORY_SEPARATOR
*/
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
/**
* This is the shortcut to Yii::app()
*/
function app() {
return Yii: :app();
}
/**
* This is the shortcut to Yii::app()->clientScript
*/
function cs() {
// You could also call the client script instance via Yii::app()->clientScript
// But this is faster
return Yii: :app() - >getClientScript();
}
/**
* This is the shortcut to Yii::app()->user.
*/
function user() {
return Yii: :app() - >getUser();
}
/**
* This is the shortcut to Yii::app()->createUrl()
*/
function url($route, $params = array(), $ampersand = '&') {
return Yii: :app() - >createUrl($route, $params, $ampersand);
}
/**
* This is the shortcut to CHtml::encode
*/
function h($text) {
return htmlspecialchars($text, ENT_QUOTES, Yii: :app() - >charset);
}
/**
* This is the shortcut to CHtml::link()
*/
function l($text, $url = '#', $htmlOptions = array()) {
return CHtml: :link($text, $url, $htmlOptions);
}
/**
* This is the shortcut to Yii::t() with default category = 'stay'
*/
function t($message, $category = 'stay', $params = array(), $source = null, $language = null) {
return Yii: :t($category, $message, $params, $source, $language);
}
/**
* This is the shortcut to Yii::app()->request->baseUrl
* If the parameter is given, it will be returned and prefixed with the app baseUrl.
*/
function bu($url = null) {
static $baseUrl;
if ($baseUrl === null) $baseUrl = Yii: :app() - >getRequest() - >getBaseUrl();
return $url === null ? $baseUrl: $baseUrl.'/'.ltrim($url, '/');
}
/**
* Returns the named application parameter.
* This is the shortcut to Yii::app()->params[$name].
*/
function param($name) {
return Yii: :app() - >params[$name];
}
/**
* A useful one that I use in development is the following
* which dumps the target with syntax highlighting on by default
*/
function dump($target) {
return CVarDumper: :dump($target, 10, true);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有