<?php return ['name' => 'География', 'autoload' => true, 'widgets' => ['Geography\\cityData' => ['name' => 'Вариатор данных по городам', 'params' => function () { App::$cur->Ui; \App::$cur->libs->loadLib('ckeditor'); $dataSets = Geography\City\Data::getList(['order' => ['code']]); ?> <div class="form-group"> <label>Группа данных</label> <select class ="form-control groupSelect" onchange="changeGroupSelect(this);"> <option value = 0>Выберите группу</option> <?php $isset = []; $datas = []; foreach ($dataSets as $set) { $datas[$set->code][$set->city_id] = $set->data; if (empty($isset[$set->code])) { $isset[$set->code] = true; echo "<option value = '{$set->code}'>{$set->code}</option>"; } } ?> <option value = -1>Создать</option> </select> </div> <script> var changerData = <?php echo json_encode($datas); ?> ; function changeGroupSelect(select) {
<?php echo Geography\City\Data::get([['code', $params[0]], ['city_id', Geography\City::$cur->id]])->data;