use yii\helpers\Html; use common\components\widgets\ActiveForm; use shop\models\Category; /* @var $this yii\web\View */ /* @var $model shop\models\Category */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="category-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'pid')->dropDownList(Category::selTree(), ['prompt' => '顶级']); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'cover')->fileInput(); ?> <?php echo $form->field($model, 'body')->textarea(['rows' => 6]); ?> <div class="form-group">
/* @var $model shop\models\Attr */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="attr-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'category_id')->dropDownList(Category::selTree()); ?> <?php echo $form->field($model, 'is_multi')->radioList(['否', '是']); ?> <?php echo $form->field($model, 'body')->textarea(['rows' => 6]); ?> <div class="form-group"> <div class="col-sm-offset-2 col-sm-3"> <?php echo Html::submitButton('保 存', ['class' => 'btn btn-primary btn-block']); ?>