if(!$this->save()){
print_r($this->getErrors());
}
/**
* @return \yii\db\ActiveQuery
*/
public function getUser()
{
return $this->hasOne(Profile::className(), ['user_id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSubcategory()
{
return $this->hasOne(Subcategory::className(), ['id' => 'id_subcategory']);
}
<?= $form->field($model, 'id_education_stage')->dropDownList(
\yii\helpers\ArrayHelper::map(\app\models\EducationStage::find()->all(), 'id', 'name'),
['prompt' => 'Выберите уровень образования',
'id' => 'stage']
) ?>
<?= $form->field($model, 'id_scientific_degree', ['options' =>['style' => 'display:none']])->dropDownList(
\yii\helpers\ArrayHelper::map(\app\models\ScientificDegree::find()->all(), 'id', 'name'),
[
'prompt' => 'Выберите',
]
)?>
<?php
$this->registerJs("
$('#stage').on('change', function(){
if($(this).val() == 1){
$(this).parent('.form-group').next().show()
}
else{
$(this).parent('.form-group').next().hide()
}
})
", View::POS_END);
?>
вывести во вью update_competence?