From cab1a44698e6e04df7cfeb383ec48a30984448eb Mon Sep 17 00:00:00 2001 From: "origami11@yandex.ru" Date: Tue, 28 Nov 2023 17:35:48 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=9F=D1=80=D0=B5=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D1=81=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=B8=20=D0=BA=20=D1=81=D0=BA=D1=80?= =?UTF-8?q?=D0=B8=D0=BF=D1=82=D0=B0=D0=BC=20=D0=B8=20=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tales.php | 4 ++-- src/View/View.php | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Tales.php b/src/Tales.php index 5937db2..7cbd91c 100644 --- a/src/Tales.php +++ b/src/Tales.php @@ -51,7 +51,7 @@ class Tales { return date("H:i", $e); } - static function phptal_asset($s) { + static function phptal_asset($s) { self::$site->addStyleSheet($s); return ""; } @@ -59,7 +59,7 @@ class Tales { /** * Функция подключения компонента */ - static function phptal_component ($expression) { + static function phptal_component($expression) { $begin = floatval(microtime(true)); $component/*: Component*/ = null; diff --git a/src/View/View.php b/src/View/View.php index 088cd43..a30e9fa 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -15,8 +15,9 @@ class View protected $_title = null; // Заголовок текущего шаблона - public $active_module; - public $module_action; + public $active_module; + public $module_action; + public $prefix; public $suggestions; //подсказки @@ -59,7 +60,7 @@ class View */ public function addScript($name) { - $output = $this->resolveName($this->alias, $name); + $output = $this->resolveName($this->alias, $name . '?' . http_build_query($this->prefix)); $this->_script [] = $output; } @@ -77,6 +78,10 @@ class View } } + public function setPrefix($name, $val) { + $this->prefix[$name] = $val; + } + /** * Добавляет стили к текущему шаблону * @@ -84,8 +89,8 @@ class View */ public function addStyleSheet($name) { - $output = $this->resolveName($this->alias, $name); - $this->_stylesheet [] = $output; + $output = $this->resolveName($this->alias, $name . '?' . http_build_query($this->prefix)); + $this->_stylesheet [] = $output; } /**