protected function executeAfter() { if (TFRouter::getEnv() == 'xhtml') { $this->_view->assign('js', $this->_js); $this->_output .= $this->_view->fetch('footer' . DIRECTORY_SEPARATOR . 'xhtml' . DIRECTORY_SEPARATOR . 'main.tpl.php'); } foreach ($this->_headers as $header) { header($header); } }
/** * sets the view * @access protected */ protected function setView() { if ($this->_model) { $this->_view->assign('model', $this->_model); } $this->_view->assign('options', $this->_options); if (in_array(TFRouter::getEnv(), $this->_envs)) { $folder = TFRouter::getEnv(); } else { $folder = $this->_def_env; } if (strlen($this->_action) > 0) { if (in_array($this->_action, $this->_tpl_folders)) { $location = $this->_template_dir . _SEP_ . $this->_action . _SEP_ . $folder . _SEP_; } elseif (array_key_exists($this->_action, $this->_tpl_folders)) { $location = $this->_template_dir . _SEP_ . $this->_tpl_folders[$this->_action] . _SEP_ . $folder . _SEP_; } } else { $location = $this->_template_dir . _SEP_ . $this->_default_tpl_folder . _SEP_ . $folder . _SEP_; } $file = is_null($this->_model) == false && $this->_model->isError() ? 'errors.tpl.php' : 'main.tpl.php'; $this->_output .= $this->_view->fetch($location . $file); }