original_string: public function locateViewFile($filename, $requiredNamespace = '')
      {
          foreach ($this->templateSearchDirectories as $namespace => $location) {
              if (!empty($requiredNamespace) && ($namespace != $requiredNamespace)) {
                  continue;
              }
  
              $fullFilename = $location . DIRECTORY_SEPARATOR . str_replace('..', '', $filename);
  
              if (!$this->allowRecursion && ($fullFilename == $this->parentTemplate)) {
                  if (!empty($this->log))
                  {
                      $this->log->error("Disallowed template recursion found in filename " . $filename . ". To allow recursion, send _allowRecursion=true into the template data.");
                  }
                  return '';
              }
  
              if (is_file($fullFilename)) {
                  return $fullFilename;
              }
          }
  
          if (!empty($this->log))
          {
              $this->log->error("Invalid template filename specified " . $filename);
          }
  
          return '';
      }
code: public function locateViewFile($filename, $requiredNamespace = '')
      {
          foreach ($this->templateSearchDirectories as $namespace => $location) {
              if (!empty($requiredNamespace) && ($namespace != $requiredNamespace)) {
                  continue;
              }
  
              $fullFilename = $location . DIRECTORY_SEPARATOR . str_replace('..', '', $filename);
  
              if (!$this->allowRecursion && ($fullFilename == $this->parentTemplate)) {
                  if (!empty($this->log))
                  {
                      $this->log->error("Disallowed template recursion found in filename " . $filename . ". To allow recursion, send _allowRecursion=true into the template data.");
                  }
                  return '';
              }
  
              if (is_file($fullFilename)) {
                  return $fullFilename;
              }
          }
  
          if (!empty($this->log))
          {
              $this->log->error("Invalid template filename specified " . $filename);
          }
  
          return '';
      }
code_tokens: public function locateViewFile ( $ filename , $ requiredNamespace = '' ) { foreach ( $ this -> templateSearchDirectories as $ namespace => $ location ) { if ( ! empty ( $ requiredNamespace ) && ( $ namespace != $ requiredNamespace ) ) { continue ; } $ fullFilename = $ location . DIRECTORY_SEPARATOR . str_replace ( '..' , '' , $ filename ) ; if ( ! $ this -> allowRecursion && ( $ fullFilename == $ this -> parentTemplate ) ) { if ( ! empty ( $ this -> log ) ) { $ this -> log -> error ( "Disallowed template recursion found in filename " . $ filename . ". To allow recursion, send _allowRecursion=true into the template data." ) ; } return '' ; } if ( is_file ( $ fullFilename ) ) { return $ fullFilename ; } } if ( ! empty ( $ this -> log ) ) { $ this -> log -> error ( "Invalid template filename specified " . $ filename ) ; } return '' ; }
docstring: Locate a desired view file
  
  @param string $filename
  @param string $requiredNamespace
  @return string
docstring_tokens: Locate a desired view file