tree = $this->makeTree($this->treeArray); } public function run() { return $this->render('tree_widget', [ 'tree' => $this->tree, 'tableBodies' => $this->tableBodies, ]); } private function makeTree($array) { $html = ''; return $html; } private function makeTableBody($properties) { $tableBody = ''; $form_fields_names = array(); foreach ($properties->properties as $property) { $tableBody .= ''; $tableBody .= ''; $tableBody .= $property->name; $tableBody .= ''; $tableBody .= ''; $tableBody .= $property->value; $tableBody .= ''; $tableBody .= ''; $form_fields_names[] = $property->name; } $tableBody .= ''; $tableBody .= ''; $tableBody .= Html::button('Добавить данные', ['value' => Url::to(['student/portfolio/get-form']), 'data' => json_encode($form_fields_names), 'title' => 'Добавление данных', 'class' => 'showModalButton btn btn-sm btn-primary']); $tableBody .= ''; $tableBody .= ''; $tableBody .= ''; return $tableBody; } }