Beispiel #1
0
 public function getRiskLevel()
 {
     return $this->hasOne(RiskLevel::className(), ['id' => 'risk_level_id']);
 }
Beispiel #2
0
     </div> 
  
 <div class="col-xs-6 col-sm-6">
    <?php 
echo $form->field($model, 'risk_solve_begin')->textarea(['rows' => 3]);
?>
 </div>
   <div class="col-xs-6 col-sm-6">
    <?php 
echo $form->field($model, 'risk_sum_solve')->textarea(['rows' => 3]);
?>
   </div>

 <div class="col-xs-6 col-sm-6"> 
     <?php 
echo $form->field($model, 'risk_level')->widget(Select2::classname(), ['data' => ArrayHelper::map(RiskLevel::find()->all(), 'level', 'name'), 'options' => ['placeholder' => 'เลือกระดับความรุนแรง ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
  
  </div>
 <div class="col-xs-6 col-sm-6">  
    <?php 
echo $form->field($model, 'risk_head_department')->textInput(['maxlength' => true]);
?>
</div>
 
    
   <div class="col-sm-4 col-md-4">
       <?php 
echo $form->field($model, 'risk_program_head')->dropdownList(ArrayHelper::map(ProgramHead::find()->all(), 'id', 'name'), ['id' => 'ddl-risk_program_head', 'prompt' => 'เลือกโปรแกรมความเสี่ยง']);
?>
    </div>