Пример #1
0
 public function __ModelGetAllTables($rowParams = [], $value = "", $item = [])
 {
     $rowParams = ArrayHelper::toArray($rowParams);
     $model = new ModelAdmin();
     $model->table = "backend__id_db";
     $params = Yii::$app->request->bodyParams;
     if (!empty($params) && !empty($value)) {
         $model_tables = new \app\modelsActiveRecords\Tables();
         $model_tables->Add($value, ['name' => $params["name"]]);
     }
     $params = $this->MakeRowParams($rowParams["params"]);
     $tables = $model->GetTableList();
     $getActiveTable = $model->GetItems(['name'], ['model_id' => $value]);
     $activeTable = isset($getActiveTable[0]["name"]) ? $getActiveTable[0]["name"] : "";
     $tag = Html::label($rowParams["label"], $rowParams["name"]);
     $tag .= Html::dropDownList($this->ReturnGroup($rowParams), $activeTable, $tables, $params);
     return $tag;
 }
Пример #2
0
 /**
  * Получает данные из таблицы
  * @param type $rowParams
  * @param type $value
  * @return type
  */
 public function fromTableSelect($rowParams = [], $value = "", $item = [])
 {
     $model = new ModelAdmin();
     $params = $this->MakeRowParams($rowParams["params"]);
     $table = isset($params["table"]) ? $params["table"] : "";
     unset($params["table"]);
     $model->table = $table;
     $listObject = $model->GetItems(["id", "name"]);
     $list = ArrayHelper::map($listObject, "id", "name");
     $tag = Html::label($rowParams["label"], $rowParams["name"]);
     $tag .= Html::dropDownList($this->ReturnGroup($rowParams), $value, $list, $params);
     return $tag;
 }