/
ouke
/
amk
Обзор
Документация
Войти
/
ouke
/
amk
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
admin/controller/startup/router.php
37 строк
943 B
Руслан
first_commit
09 июл 2025, 07:27
09 июл 2025, 07:27
24f61ee
Код
Авторство
О чём код?
<?php class ControllerStartupRouter extends Controller { public function index() { // Route if (isset($this->request->get['route']) && $this->request->get['route'] != 'startup/router') { $route = $this->request->get['route']; } else { $route = $this->config->get('action_default'); } $data = array(); // Sanitize the call $route = preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route); // Trigger the pre events $result = $this->event->trigger('controller/' . $route . '/before', array(&$route, &$data)); if (!is_null($result)) { return $result; } $action = new Action($route); // Any output needs to be another Action object. $output = $action->execute($this->registry, $data); // Trigger the post events $result = $this->event->trigger('controller/' . $route . '/after', array(&$route, &$output)); if (!is_null($result)) { return $result; } return $output; } }