Пример #1
0
 /**
  * Finds the JobLevel model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return JobLevel the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = JobLevel::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #2
0
echo $form->field($model, 'username')->textInput(['maxlength' => true, 'placeholder' => '输入' . $model->getAttributeLabel("username")]);
?>
    <?php 
echo $form->field($model, 'password_hash')->passwordInput(['maxlength' => true, 'value' => '', 'placeholder' => '输入' . $model->getAttributeLabel("password_hash")]);
?>
    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true, 'placeholder' => '输入' . $model->getAttributeLabel("email")]);
?>
    <?php 
echo $form->field($model, 'nickname')->textInput(['maxlength' => true, 'placeholder' => '输入' . $model->getAttributeLabel("nickname")]);
?>
    <?php 
echo $form->field($model, 'avatar')->fileInput();
?>
    <?php 
echo $form->field($model, 'job_level')->textInput(['maxlength' => true])->dropDownList(ArrayHelper::map(JobLevel::find()->all(), 'id', 'name'));
?>
    <?php 
echo $form->field($model, 'tel')->textInput(['maxlength' => true, 'placeholder' => '输入' . $model->getAttributeLabel("tel")]);
?>
    <?php 
echo $form->field($model, 'mobile')->textInput(['maxlength' => true, 'placeholder' => '输入' . $model->getAttributeLabel("mobile")]);
?>
    <?php 
echo $form->field($model, 'status')->textInput()->dropDownList([$model::STATUS_ACTIVE => '激活', $model::STATUS_DELETED => '删除']);
?>
  </div><!-- /.box-body -->

  <div class="box-footer">
    <?php 
echo Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);