/** * Свойства модели * @return string */ public function actionProperty() { $id = yii::$app->request->get('id') ? (int) yii::$app->request->get('id') : 0; if ($id) { $m_tabs = new Tabs(); $m_tables = new Tables(); $m_rows = new Rows(); $item = $this->GetModel()->GetItem($id); $data['rows'] = $m_rows->GetRows($id); $data['tabs'] = $m_tabs->GetItems($id); $table_columns = $m_tables->GetTableForModelId($id); $data['column'] = $this->GetModel()->GetColumnFromTable($table_columns); $this->titlePage = "Модель " . $item["name"]; $this->headerPage = "Свойство модели / " . $item["name"]; if (isset($_POST["saveAction"])) { if (isset(yii::$app->request->bodyParams["row"])) { $fields = yii::$app->request->bodyParams["row"]; foreach ($fields as $id_section => $value) { $m_rows->Add($id_section, $value, $id); } } $this->redirect(Url::to(["/models/catalog/property", "id" => $id])); } return $this->render('property', ["data" => $data, "id" => $id]); } }