public function getBackLink($fallback = '')
    {
        $url = '';

        if ($this->owner->Request) {
            if ($this->owner->Request->requestVar('BackURL')) {
                $url = $this->owner->Request->requestVar('BackURL');
            } else {
                if ($this->owner->Request->isAjax() && $this->owner->Request->getHeader('X-Backurl')) {
                    $url = $this->owner->Request->getHeader('X-Backurl');
                } else {
                    if ($this->owner->Request->getHeader('Referer')) {
                        $url = $this->owner->Request->getHeader('Referer');
                    }
                }
            }
        }

        if (!$url) {
            $url = $fallback ? $fallback : singleton('director')->baseURL();
        }

        return $url;
    }
public function getBackLink($fallback = '')
    {
        $url = '';

        if ($this->owner->Request) {
            if ($this->owner->Request->requestVar('BackURL')) {
                $url = $this->owner->Request->requestVar('BackURL');
            } else {
                if ($this->owner->Request->isAjax() && $this->owner->Request->getHeader('X-Backurl')) {
                    $url = $this->owner->Request->getHeader('X-Backurl');
                } else {
                    if ($this->owner->Request->getHeader('Referer')) {
                        $url = $this->owner->Request->getHeader('Referer');
                    }
                }
            }
        }

        if (!$url) {
            $url = $fallback ? $fallback : singleton('director')->baseURL();
        }

        return $url;
    }
public function getBackLink ( $ fallback = '' ) { $ url = '' ; if ( $ this -> owner -> Request ) { if ( $ this -> owner -> Request -> requestVar ( 'BackURL' ) ) { $ url = $ this -> owner -> Request -> requestVar ( 'BackURL' ) ; } else { if ( $ this -> owner -> Request -> isAjax ( ) && $ this -> owner -> Request -> getHeader ( 'X-Backurl' ) ) { $ url = $ this -> owner -> Request -> getHeader ( 'X-Backurl' ) ; } else { if ( $ this -> owner -> Request -> getHeader ( 'Referer' ) ) { $ url = $ this -> owner -> Request -> getHeader ( 'Referer' ) ; } } } } if ( ! $ url ) { $ url = $ fallback ? $ fallback : singleton ( 'director' ) -> baseURL ( ) ; } return $ url ; }
Find a back link for current controller
@param string $fallback
@return string
Find a back link for current controller