original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Find a back link for current controller
  @param string $fallback
  @return string
docstring_tokens: Find a back link for current controller