From d71eacbba6167668a9f878baaf23475e99cb0a73 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 16 Aug 2015 19:32:21 +0530 Subject: [PATCH] Add new constant to match variable name change. --- src/View/View.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/View/View.php b/src/View/View.php index 903acec8600..1f0c5dd6020 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -268,9 +268,17 @@ class View implements EventDispatcherInterface * Constant for view file type 'view' * * @var string + * @deprecated 3.0.1 Use TYPE_TEMPLATE instead. */ const TYPE_VIEW = 'view'; + /** + * Constant for view file type 'template'. + * + * @var string + */ + const TYPE_TEMPLATE = 'view'; + /** * Constant for view file type 'element' * @@ -562,7 +570,7 @@ public function render($view = null, $layout = null) } if ($view !== false && $viewFileName = $this->_getViewFileName($view)) { - $this->_currentType = static::TYPE_VIEW; + $this->_currentType = static::TYPE_TEMPLATE; $this->dispatchEvent('View.beforeRender', [$viewFileName]); $this->Blocks->set('content', $this->_render($viewFileName)); $this->dispatchEvent('View.afterRender', [$viewFileName]); @@ -772,7 +780,7 @@ public function exists($name) */ public function extend($name) { - if ($name[0] === '/' || $this->_currentType === static::TYPE_VIEW) { + if ($name[0] === '/' || $this->_currentType === static::TYPE_TEMPLATE) { $parent = $this->_getViewFileName($name); } else { switch ($this->_currentType) {