public function __construct($request, $response, $adm_data = array()) { parent::__construct($request, $response); $this->init(); // Инициализация twig $model_widget = new Model_Widget(); $this->module_config["methods"] = get_class_methods($this); $action_pattern = "/action_(.+)/"; foreach ($this->module_config["methods"] as $key => $method) { if (preg_match($action_pattern, $method)) { $action = preg_replace($action_pattern, "\$1", $method); $this->module_config["actions"][] = $action; } } //if ($this->request->param('id', false)) $widget_id = $this->request->param('id'); $this->action = $this->request->action(); if ($adm_data) { $widget_id = $adm_data["widget_id"]; $this->action = $adm_data["action"]; } $this->widget_data = $model_widget->getWidgetData($widget_id); $this->widget_options = json_decode($this->widget_data["options"], true); }