Example #1
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yagerguo\yii2post\models\Category;
?>

<div class="post-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'categoryId')->dropDownList(['' => ''] + Category::dropDownData())->label('分类');
?>

    <?php 
echo $form->field($model, 'slug')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'content')->widget(\yii\redactor\widgets\Redactor::className());