<div class="codebody" id="code62881"> /* normalizes the input parameter to be a valid URL. If the input parameter is an empty string,the currently requested URL will be returned. If the input parameter is a non-empty string,it is treated as a valid URL and will be returned without any change.
If the input parameter is an array,it is treated as a controller route and a list of GET parameters,and the {@link CController::createUrl} method will be invoked to create a URL. In this case,the first array element refers to the controller route, and the rest key-value pairs refer to the additional GET parameters for the URL. For example,array('post/list','page'=>3) may be used to generate the URL /index.PHP?r=post/list&page=3. @param mixed $url the parameter to be used to generate a valid URL @return string the normalized URL / public static function normalizeUrl($url) { if(is_array($url)) { if(isset($url[0])) { if(($c=Yii::app()->getController())!==null) $url=$c->createUrl($url[0],array_splice($url,1)); else $url=Yii::app()->createUrl($url[0],1)); } else $url=''; } return $url==='' ? Yii::app()->getRequest()->getUrl() : $url; }