original_string: public function referrer($default = null, $attributes = null)
      {
          $referrer = $_SERVER['HTTP_REFERER'] ?? null;
  
          // Check that referrer came from our site.
          $root = $this->rootUrl(true);
          if ($referrer) {
              // Referrer should always have host set and it should come from the same base address.
              if (stripos($referrer, $root) !== 0) {
                  $referrer = null;
              }
          }
  
          if (!$referrer) {
              $referrer = $default ?: $this->route(true, true);
          }
  
          if ($attributes) {
              $referrer .= $attributes;
          }
  
          // Return relative path.
          return substr($referrer, strlen($root));
      }
code: public function referrer($default = null, $attributes = null)
      {
          $referrer = $_SERVER['HTTP_REFERER'] ?? null;
  
          // Check that referrer came from our site.
          $root = $this->rootUrl(true);
          if ($referrer) {
              // Referrer should always have host set and it should come from the same base address.
              if (stripos($referrer, $root) !== 0) {
                  $referrer = null;
              }
          }
  
          if (!$referrer) {
              $referrer = $default ?: $this->route(true, true);
          }
  
          if ($attributes) {
              $referrer .= $attributes;
          }
  
          // Return relative path.
          return substr($referrer, strlen($root));
      }
code_tokens: public function referrer ( $ default = null , $ attributes = null ) { $ referrer = $ _SERVER [ 'HTTP_REFERER' ] ?? null ; // Check that referrer came from our site. $ root = $ this -> rootUrl ( true ) ; if ( $ referrer ) { // Referrer should always have host set and it should come from the same base address. if ( stripos ( $ referrer , $ root ) !== 0 ) { $ referrer = null ; } } if ( ! $ referrer ) { $ referrer = $ default ? : $ this -> route ( true , true ) ; } if ( $ attributes ) { $ referrer .= $ attributes ; } // Return relative path. return substr ( $ referrer , strlen ( $ root ) ) ; }
docstring: Return relative path to the referrer defaulting to current or given page.
  
  @param string $default
  @param string $attributes
  
  @return string
docstring_tokens: Return relative path to the referrer defaulting to current or given page .