/** * Render view. Textile views are rendered within layout. * * @param array $vars List of variables passed to text processors * * @return string */ public function render($vars = array()) { $view = parent::render($vars); if ($this->hasLayout()) { // inject global site and front matter options into template $vars = array_merge($vars, $this->getParams()); $view = $this->applyLayout($view, $vars); } return $view; }
/** * Set input file path. Overriden to update processor options. * * @param string $file Path to file * * @return \Phrozn\Site\View */ public function setInputFile($path) { parent::setInputFile($path); $processors = $this->getProcessors(); if (count($processors)) { $options = array('phr_template_filename' => basename($path), 'phr_template_dir' => dirname($path)); $processor = array_pop($processors); $processor->setConfig($options); } return $this; }
/** * Initialize view * * @param string $inputFile Path to view source file * @param string $outputDir File destination path * * @return \Phrozn\Site\View */ public function __construct($inputFile = null, $outputDir = null) { parent::__construct($inputFile, $outputDir); $this->addProcessor(new Processor()); }
/** * Render view. Twig views are rendered within layout. * * @param array $vars List of variables passed to text processors * * @return string */ public function render($vars = array()) { return parent::render($vars); }