I follow the tutorial and it uses download. I am not sure how to resize the text box for Lan_Id, Name and Employee_Number. I think I'm starting to understand the structure of Yii.
here is the view of userForm.php
<?php use yii\helpers\HTML; use yii\widgets\ActiveForm; ?> <?php if(Yii::$app->session->hasFlash('success')) { echo Yii::$app->session->getFlash('success'); } ?> <?php $form = ActiveForm::begin();?> <?= $form->field($model,'Lan_Id');?> <?= $form->field($model,'Name');?> <?= $form->field($model,'Employee_Number');?> <?= Html::submitButton('Submit', ['class'=>'btn btn-success']);
Here is the UserForm.php model
<?php namespace app\models; use yii\base\Model; class UserForm extends Model { public $Lan_Id; public $Name; public $Employee_Number; public function rules() { return [ [['Lan_Id','Name','Employee_Number'],'required'], ]; } }
source share