setEncoding('utf-8'); $view->css = array('default'); $view->head_js = array(); $view->body_js = array(); $view->addHelperPath(dirname(__FILE__).'/Helpers/'); $options = array('viewSuffix'=>'phtml'); parent::__construct($view, $options); } /** * Set the layout script to be rendered. * * @param string $script */ public function setLayoutScript($script) { $this->_layoutScript = $script; } /** * Retreive the name of the layout script to be rendered. * * @return string */ public function getLayoutScript() { return $this->_layoutScript; } /** * Render the action script and assign the the view for use * in the layout script. Render the layout script and append * to the Response's body. * * @param string $script * @param string $name */ public function renderScript($script, $name = null) { $this->view->baseUrl = $this->getRequest()->getBaseUrl(); if (null === $name) { $name = $this->getResponseSegment(); } // assign action script name to view. $this->view->actionScript = $script; // render layout script and append to Response's body $layoutScript = $this->getLayoutScript(); $layoutContent = $this->view->render($layoutScript); $this->getResponse()->appendBody($layoutContent, $name); $this->setNoRender(); } }