isNewRecord) {//如果是编辑分类 $cate = ArrayHelper::map(Category::find()->andWhere('id != :id', [':id' => $model->id])->all(), 'id', 'title'); } else {//如果是新建分类 $cate = ArrayHelper::map(Category::find()->all(), 'id', 'title'); } ?>= $form->field($model, 'title')->textInput(['maxlength' => 100])->label("分类标题") ?> = $form->field($model, 'name')->textInput(['maxlength' => 100])->label("分类别名") ?> = $form->field($model, 'pid')->dropDownList($cate, ['prompt' => '请选择父分类'])->label("父分类") ?> = $form->field($model, 'keywords')->textarea(['maxlength' => 255])->label("分类关键词") ?> = $form->field($model, 'description')->textarea(['maxlength' => 255])->label("分类描述") ?>= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-block btn-success' : 'btn btn-block btn-primary']) ?>