Task/ReportHookPresets.php
protected function loadPresetsFile($filename) {
    $pieces = array('templates', $this->environment->getCoreMajorVersion(), $filename);
    $path = $this->environment->getPath(implode('/', $pieces));

    if (!file_exists($path)) {
      throw new \Exception(strtr("Unable to find template at !path.", array(
        '!path' => htmlspecialchars($path, ENT_QUOTES, 'UTF-8'),
      )));
    }

    $template_file = file_get_contents($path);
    return $template_file;
  }
protected function loadPresetsFile($filename) {
    $pieces = array('templates', $this->environment->getCoreMajorVersion(), $filename);
    $path = $this->environment->getPath(implode('/', $pieces));

    if (!file_exists($path)) {
      throw new \Exception(strtr("Unable to find template at !path.", array(
        '!path' => htmlspecialchars($path, ENT_QUOTES, 'UTF-8'),
      )));
    }

    $template_file = file_get_contents($path);
    return $template_file;
  }
protected function loadPresetsFile ( $ filename ) { $ pieces = array ( 'templates' , $ this -> environment -> getCoreMajorVersion ( ) , $ filename ) ; $ path = $ this -> environment -> getPath ( implode ( '/' , $ pieces ) ) ; if ( ! file_exists ( $ path ) ) { throw new \ Exception ( strtr ( "Unable to find template at !path." , array ( '!path' => htmlspecialchars ( $ path , ENT_QUOTES , 'UTF-8' ) , ) ) ) ; } $ template_file = file_get_contents ( $ path ) ; return $ template_file ; }
Returns the contents of a template file.

TODO: this will eventually return either the user version or the module version.
TODO: IS THIS IN THE RIGHT FILE???

@param $filename
The filename of the template file to read.

@return
The contents of the file, or NULL if the file is not found.

@throws \Exception
Throws an exception if the file can't be found.
Returns the contents of a template file .