if (isset($model->game_id) ){
$gameValue = ArrayHelper::map(Game::find()->where(['id' => $model->game_id])->all(), 'id', 'name');
}else{
$gameValue = [];
<?= $form->field($model, 'game_id')->label('')->widget(DepDrop::classname(), [
'data' =>$ gameValue,
'type' => DepDrop::TYPE_SELECT2,
'options' => ['multiple' => true],
'disabled' =>false,
'pluginOptions'=>[
'depends'=>['platform_id'],
'placeholder'=>'- ' . Yii::t('main', 'Select games') . ' -',
'url'=>Url::to(['/user/default/getgame'])
]
])
?>
private function getCountry($countryId = null){
if (isset($countryId)){
$result = Country::getDb()->cache(function ($db) {
return Country::find()->select('id, name')->asArray()->indexBy('id')->all();
});
return $result[$countryId]['name'];
}
return null;
}
Yii::t('frontend', 'About {name}', ['name' => '<strong>'.$model->name.'</strong>']),
'About {name}' => 'Подробнее о {name}',