3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\View\Helper
;
12 use Zend\View\Model\ModelInterface
as Model
;
15 * Helper for storing and retrieving the root and current view model
17 class ViewModel
extends AbstractHelper
30 * Set the current view model
35 public function setCurrent(Model
$model)
37 $this->current
= $model;
42 * Get the current view model
46 public function getCurrent()
48 return $this->current
;
52 * Is a current view model composed?
56 public function hasCurrent()
58 return ($this->current
instanceof Model
);
62 * Set the root view model
67 public function setRoot(Model
$model)
74 * Get the root view model
78 public function getRoot()
84 * Is a root view model composed?
88 public function hasRoot()
90 return ($this->root
instanceof Model
);