Ejemplo n.º 1
0
    <?php 
$form = ActiveForm::begin();
?>

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

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


    <?php 
echo CategoryDropDownList::widget(['model' => $model, 'attribute' => 'parent', 'options' => ['class' => 'form-control'], 'currentOptionDisabled' => $model->isNewRecord ? false : true]);
?>

    <?php 
echo $form->field($model, 'description')->textarea(['maxlength' => 200]);
?>


    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? '增加分类' : '编辑分类', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
Ejemplo n.º 2
0
use yii\widgets\ActiveForm;
use common\models\Article;
use dosamigos\datepicker\DatePicker;
use kucha\ueditor\UEditor;
/* @var $this yii\web\View */
/* @var $model common\models\Article */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="article-form col-md-12">
    <?php 
$form = ActiveForm::begin();
?>
    <div class="col-md-8">
        <?php 
echo \common\widgets\CategoryDropDownList::widget(['model' => $model, 'attribute' => 'category_id', 'options' => ['class' => 'form-control', 'style' => 'width:40%']]);
?>
        <?php 
echo $form->field($model, 'title')->textarea(['maxlength' => true, 'rows' => 2]);
?>

        <?php 
echo $form->field($model, 'content')->widget('kucha\\ueditor\\UEditor', ['clientOptions' => ['initialFrameHeight' => '400', 'lang' => 'zh-cn']]);
?>
    </div>
    <div class="col-md-4">

        <?php 
echo $form->field($model, 'author')->textInput(['maxlength' => true]);
?>
        <?php 
Ejemplo n.º 3
0
        <div class="col-md-8">
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'description')->textarea(['rows' => 3, 'maxlength' => true]);
?>
            <div class="form-group">
                <?php 
echo Html::submitButton($model->isNewRecord ? '新建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
            </div>
        </div>
        <div class="col-md-4">
            <?php 
echo \common\widgets\CategoryDropDownList::widget(['model' => $model, 'attribute' => 'parent', 'parent' => $model->parent, 'options' => ['class' => 'form-control'], 'currentOptionDisabled' => Yii::$app->controller->action->id == 'update' ? true : false]);
?>
            <?php 
echo $form->field($model, 'slug')->textInput(['maxlength' => true]);
?>

            <?php 
echo $form->field($model, 'status')->radioList([Category::STATUS_DISPLAY => '可用', Category::STATUS_HIDE => '禁用']);
?>
        </div>

        <?php 
ActiveForm::end();
?>
    </div>
</div>