コード例 #1
0
ファイル: PhpView.php プロジェクト: xyphex/issi-view
 /**
  * Construct a new view pointing to a PHP script.
  *
  * @param string $path Path of the script to point at.
  * @param array $data Associative array of data to bind to the view.
  *
  * @throws IssiView\Exception\ViewPathException if the script at $path
  *     doesn't exist, isn't a file, or isn't readable.
  *
  * @uses \Xyphex\IssiView\AbstractView::__construct()
  * @uses \Xyphex\IssiView\View\PhpView::setData()
  */
 public function __construct(string $path, array $data = [])
 {
     parent::__construct($path);
     foreach ($data as $name => $value) {
         $this->setData($name, $value);
     }
 }
コード例 #2
0
ファイル: FileView.php プロジェクト: xyphex/issi-view
 /**
  * Construct a new view pointing to a file.
  *
  * @param string $path Path of the file to point at.
  *
  * @throws IssiView\Exception\ViewPathException if the file at $path doesn't
  *     exist, isn't a file, or isn't readable.
  *
  * @uses \Xyphex\IssiView\AbstractView::__construct()
  */
 public function __construct(string $path)
 {
     parent::__construct($path);
 }