layout) { throw new MJException('$layout not set in '.get_class($this)); } $this->templater = Load::templater(); } /** * Основной метод вывода * */ function display(Action $action) { $this->action = $action; $this->templater->assign($this->action_name, $this->action->display(), $this->layout); $this->exec(); $this->templater->setPath(WRAPPERS_TPL_PATH); return $this->templater->fetch($this->layout); } /** * Добавить данные на вывод * * @param string $var_name - имя переменной, в которую будет осуществлен вывод * @param Action $action - действие * @param Decorator $decorator - декоратор, в котором должно выполнится действие. */ function addOutput($var_name, Action $action, Decorator $decorator = null) { $this->templater->assign($var_name, $decorator ? $decorator->display($action) : $action->display(), $this->layout); } /** * Основной метод для дочерних декораторов * */ abstract function exec(); } ?>