Revision #5 has been created by jonah on Aug 22, 2009, 7:28:31 PM with the memo:
optimized bu()
« previous (#4) next (#6) »
Changes
Title
unchanged
Use shortcut functions to reduce typing
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
Content
changed
[...]
/**
* 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();
}[...]
static $baseUrl;
if ($baseUrl===null)
$baseUrl=Yii::app()->rgetRequest
->b()->getBaseUrl
();
return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');
}
/**
* Returns the named application parameter.[...]