$('#select-branch').change(function () {
let value = $(this).val();
console.log(value);
if ($(this).val() !== null){
$.ajax({
type: 'get',
url: `${window.location.origin}/branch/rooms/${value}`,
beforeSend: function () {
$('.select-room').css('display', 'block').html(`<option value="" disabled selected>Загрузка</option>`)
}
})
.done(res => {
console.log(res);
let room = res.map(room => {
return `<option value="${room.id}">${room.name}</option>`
});
$('.select-room').css('display', 'block').html(`<option value="" disabled selected>Выберите комнату</option>${room}`);
})
.fail(err => console.error(err.responseJSON.message));
}
})
class Direction extends Model
{
protected $table = 'direction';
protected $fillable = ['id_user', 'name'];
public function executes()
{
return $this->belongsToMany('Growth\Execute', 'execute_direction');
}
}
$arr = [];
$directions = Direction::where('id_user', Auth::user()->id)->get();
foreach ($directions as $value){
$execute = Direction::find($value->id)->executes()->get();
foreach ($execute as $key => $item){
$arr[$value->id]['name'] = $value->name;
$arr[$value->id]['execute'][$item->id]['name'] = $item->name;
$arr[$value->id]['execute'][$item->id]['last_name'] = $item->name;
}
}
$_POST['EditUserAdmin']['username']
на такие Yii::$app->request->post('EditUserAdmin')['username']
Ну если Вы используете Yii2Yii::$app->response->redirect(Url::to('index')
this->redirect(['controller/index'])
if($user->save()){
return $user->getErrrors();
}
var_dump(Yii::$app->response->post());
<input type="radio" class="cent" name="center" value="Воронеж, Кольцовская, 4" data-email='test@mai.ru'>
<a href="file://localhost/C:/YandexDisk/Блоги/new_1.html" class="w7"></a>