12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace Cube\Application\Resource;
- use Cube\View as ViewObject;
- class View extends AbstractResource
- {
-
- protected $_view;
-
-
- public function getView()
- {
- return $this->_view;
- }
-
- public function setView($view)
- {
- if (!$view instanceof ViewObject) {
- throw new \InvalidArgumentException("\Cube\Application\Resource\View requires an object of type \Cube\View");
- }
-
- $this->_view = $view;
-
- return $this;
- }
-
- public function init()
- {
- if (!$this->_view instanceof ViewObject) {
- $view = new ViewObject();
- $view->setLayout($this->_options['view']['layout_file'])
- ->setLayoutsPath($this->_options['view']['layouts_path'])
- ->setViewsPath($this->_options['view']['views_path']);
-
- $this->setView($view);
- }
- return $this->getView();
- }
- }
|