__construct() public method

Initialize page
public __construct ( string $inputFile = null, string $outputDir = null ) : Phrozn\Site\View
$inputFile string Path to page source file
$outputDir string File destination path
return Phrozn\Site\View
Example #1
0
 /**
  * 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);
     $options = array();
     if (null !== $inputFile) {
         $options = array('phr_template_filename' => basename($inputFile), 'phr_template_dir' => dirname($inputFile));
     }
     $this->addProcessor(new Processor($options));
 }
Example #2
0
    /**
     * 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());
    }