/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/widgets/model/Form.php
51 строка
1 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\widgets\model; use common\helpers\ArrayHelper; /** * Отображение данных на редактирование * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2020 */ class Form extends BaseWidget { /** * Текущая ActiveForm * @var null */ public $form = null; /** * Выполнение виджета * * @return string */ public function run() { $fields = $this->crud->fields(); $rows = []; $the_index = 0; foreach ($fields as $name => $field) { $index = ArrayHelper::getValue($field, 'options.index', $the_index); $rows[$index] = [ 'name' => $name, 'field' => $field ]; $the_index += 10; } ArrayHelper::ksortRecursive($rows); $result = ''; foreach ($rows as $index => $row) { $result .= $this->crud->render($this->form, $this->model, $row['name'], $row['field']); } return $result; } }