fix Исправлено определение имени модуля

This commit is contained in:
origami11@yandex.ru 2022-12-09 16:09:40 +03:00
parent 7fd7c4fd12
commit 9f3523de6b
2 changed files with 8 additions and 7 deletions

View file

@ -30,7 +30,6 @@ class Action
public $modulePath = null; // Путь к модулю
public $moduleTitle = '';
public $modulePrefix = '';
public $viewPathPrefix = null; // Путь к шаблонам контроллера
@ -219,8 +218,12 @@ class Action
$url = new Url();
if ($access == null || $access->checkAction($name)) {
$moduleName = explode("\\", strtolower(get_class($this)), 2);
$param = array_merge(array('module' => $this->modulePrefix . $moduleName[1], "action" => $name), $param);
$moduleName = explode("\\", strtolower(get_class($this)));
array_shift($moduleName);
if ($moduleName[0] == $moduleName[1]) {
array_shift($moduleName);
}
$param = array_merge(array('module' => implode("\\", $moduleName), "action" => $name), $param);
$url->setParent($this->part);
$url->setQuery($param);