From 0473d410d125bcb22478d9fc82afeb06f59c88d9 Mon Sep 17 00:00:00 2001 From: "origami11@yandex.ru" Date: Thu, 13 Nov 2025 18:51:18 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=D0=A3=D0=BF=D1=80=D0=BE=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/Action.php | 86 +-------------------------------------- 1 file changed, 2 insertions(+), 84 deletions(-) diff --git a/src/Controller/Action.php b/src/Controller/Action.php index 20afb41..1c30a78 100644 --- a/src/Controller/Action.php +++ b/src/Controller/Action.php @@ -47,16 +47,10 @@ class Action implements ActionInterface public $part = null; /** @var \ctiso\Registry Ссылка на настройки */ - public $config; + public $config; /** @var \ctiso\Role\User Обьект пользователя */ public $user; - /** @var \ctiso\View\View Для Widgets */ - public $view = null; - - public array $childNodes = []; - public array $ctrlValues = []; - public array $childViews = []; function __construct() { $this->part = new Url(); @@ -216,11 +210,7 @@ class Action implements ActionInterface public function execute(HttpRequest $request) { $result = $this->preProcess($request); - if (!empty($result)) { - $this->view = $result; - } - $text = $this->render(); - return $text; + return $result; } /** @@ -352,78 +342,6 @@ class Action implements ActionInterface return $result->export(); } - /** - * @param string $name - */ - public function setView($name): void - { - $this->view = $this->getView($name); - } - - /** - * Установка заголовка для отображения - * @param string $title - */ - public function setTitle($title): void - { - $this->view->setTitle($title); - } - - /** - * Добавление widget к отображению - * @param string $section - * @param View $node - */ - public function addChild($section, $node): void - { - $this->childNodes[$section] = $node; - } - - /** - * Установка значения контроллера - * @param string $name - * @param mixed $value - */ - public function setValue($name, $value): void - { - $this->ctrlValues[$name] = $value; - } - - /** - * Добавление дочернего отображения к текущему отображению - * @param string $section - * @param View $node - */ - public function addView($section, $node): void - { - $this->childViews[$section] = $node; - } - - /** - * Генерация содержания - * Путаница c execute и render - * @return View|string - */ - public function render() - { - $view = $this->view; - if ($view instanceof View) { - $this->view->assignValues($this->ctrlValues); - - /** @var ?Composite $node */ - $node = null; - foreach ($this->childNodes as $name => $node) { - $node->make($this); - $this->view->setView($name, $node->view); - } - - foreach ($this->childViews as $name => $node) { - $this->view->setView($name, $node); - } - } - return $this->view; - } - /** * Установка идентификатора страницы * @return int