return-url/components/EReturnUrl.php
public function getFormValue($currentPage = false, $encode = false)
    {
        if ($currentPage)
            $url = $encode ? $this->urlEncode(Yii::app()->getRequest()->getUrl()) : Yii::app()->getRequest()->getUrl();
        else
            $url = $this->getUrlFromSubmitFields();
        return $url;
    }
public function getFormValue($currentPage = false, $encode = false)
    {
        if ($currentPage)
            $url = $encode ? $this->urlEncode(Yii::app()->getRequest()->getUrl()) : Yii::app()->getRequest()->getUrl();
        else
            $url = $this->getUrlFromSubmitFields();
        return $url;
    }
public function getFormValue ( $ currentPage = false , $ encode = false ) { if ( $ currentPage ) $ url = $ encode ? $ this -> urlEncode ( Yii :: app ( ) -> getRequest ( ) -> getUrl ( ) ) : Yii :: app ( ) -> getRequest ( ) -> getUrl ( ) ; else $ url = $ this -> getUrlFromSubmitFields ( ) ; return $ url ; }
Get url from submitted data or the current page url
for usage in a hidden form element

@usage
in views/your_page.php
<pre>
CHtml::hiddenField('returnUrl', Yii::app()->returnUrl->getFormValue());
</pre>

@param bool $currentPage
@param bool $encode
@return null|string
Get url from submitted data or the current page url for usage in a hidden form element