feat: Префикс добавляется автоматически к скриптам и стилям
This commit is contained in:
parent
ad6efaf36d
commit
cab1a44698
2 changed files with 12 additions and 7 deletions
|
|
@ -59,7 +59,7 @@ class Tales {
|
||||||
/**
|
/**
|
||||||
* Функция подключения компонента
|
* Функция подключения компонента
|
||||||
*/
|
*/
|
||||||
static function phptal_component ($expression) {
|
static function phptal_component($expression) {
|
||||||
$begin = floatval(microtime(true));
|
$begin = floatval(microtime(true));
|
||||||
$component/*: Component*/ = null;
|
$component/*: Component*/ = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,9 @@ class View
|
||||||
|
|
||||||
protected $_title = null; // Заголовок текущего шаблона
|
protected $_title = null; // Заголовок текущего шаблона
|
||||||
|
|
||||||
public $active_module;
|
public $active_module;
|
||||||
public $module_action;
|
public $module_action;
|
||||||
|
public $prefix;
|
||||||
|
|
||||||
public $suggestions; //подсказки
|
public $suggestions; //подсказки
|
||||||
|
|
||||||
|
|
@ -59,7 +60,7 @@ class View
|
||||||
*/
|
*/
|
||||||
public function addScript($name)
|
public function addScript($name)
|
||||||
{
|
{
|
||||||
$output = $this->resolveName($this->alias, $name);
|
$output = $this->resolveName($this->alias, $name . '?' . http_build_query($this->prefix));
|
||||||
$this->_script [] = $output;
|
$this->_script [] = $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,6 +78,10 @@ class View
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setPrefix($name, $val) {
|
||||||
|
$this->prefix[$name] = $val;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Добавляет стили к текущему шаблону
|
* Добавляет стили к текущему шаблону
|
||||||
*
|
*
|
||||||
|
|
@ -84,7 +89,7 @@ class View
|
||||||
*/
|
*/
|
||||||
public function addStyleSheet($name)
|
public function addStyleSheet($name)
|
||||||
{
|
{
|
||||||
$output = $this->resolveName($this->alias, $name);
|
$output = $this->resolveName($this->alias, $name . '?' . http_build_query($this->prefix));
|
||||||
$this->_stylesheet [] = $output;
|
$this->_stylesheet [] = $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue