Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update passedVars.
  • Loading branch information
ADmad committed Aug 16, 2015
1 parent 6645961 commit d4da3e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/View/View.php
Expand Up @@ -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'
];

/**
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/View/ViewBuilder.php
Expand Up @@ -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,
Expand Down

0 comments on commit d4da3e7

Please sign in to comment.