From d4da3e716ea34f26db87661fcfc85d878f56e1cb Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 16 Aug 2015 15:47:59 +0530 Subject: [PATCH] Update passedVars. --- src/View/View.php | 10 ++++++++-- src/View/ViewBuilder.php | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/View/View.php b/src/View/View.php index 2046c8bb123..75cb9c65a8f 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -217,8 +217,8 @@ class View implements EventDispatcherInterface * @var array */ protected $_passedVars = [ - 'viewVars', 'autoLayout', 'helpers', 'view', 'layout', 'name', 'theme', - 'layoutPath', 'viewPath', 'plugin', 'passedArgs' + 'viewVars', 'autoLayout', 'helpers', 'template', 'layout', 'name', 'theme', + 'layoutPath', 'templatePath', 'plugin', 'passedArgs' ]; /** @@ -300,6 +300,12 @@ public function __construct( EventManager $eventManager = null, array $viewOptions = [] ) { + if (isset($viewOptions['view'])) { + $this->template($viewOptions['view']); + } + if (isset($viewOptions['viewPath'])) { + $this->templatePath($viewOptions['viewPath']); + } foreach ($this->_passedVars as $var) { if (isset($viewOptions[$var])) { $this->{$var} = $viewOptions[$var]; diff --git a/src/View/ViewBuilder.php b/src/View/ViewBuilder.php index 78ba4c42c18..c9bde06a622 100644 --- a/src/View/ViewBuilder.php +++ b/src/View/ViewBuilder.php @@ -325,8 +325,8 @@ public function build($vars = [], Request $request = null, Response $response = $data = [ 'name' => $this->_name, - 'viewPath' => $this->_templatePath, - 'view' => $this->_template, + 'templatePath' => $this->_templatePath, + 'template' => $this->_template, 'plugin' => $this->_plugin, 'theme' => $this->_theme, 'layout' => $this->_layout,