コード例 #1
0
ファイル: Array.php プロジェクト: abtris/twigZend
 /**
  * Constructor.
  *
  * @param array   $templates  An array of templates (keys are the names, and values are the source code)
  * @param string  $cache      The compiler cache directory
  * @param Boolean $autoReload Whether to reload the template is the original source changed
  *
  * @see Twig_Loader
  */
 public function __construct(array $templates, $cache = null)
 {
     parent::__construct($cache);
     $this->templates = array();
     foreach ($templates as $name => $template) {
         $this->templates[$name] = $template;
     }
 }
コード例 #2
0
ファイル: Filesystem.php プロジェクト: phishbot/Wall-of-LOL
 /**
  * Constructor.
  *
  * @param string|array $paths    A path or an array of paths where to look for templates
  * @param string       $cache      The compiler cache directory
  * @param Boolean      $autoReload Whether to reload the template is the original source changed
  *
  * @see Twig_Loader
  */
 public function __construct($paths, $cache = null, $autoReload = true)
 {
     $this->setPaths($paths);
     parent::__construct($cache, $autoReload);
 }