示例#1
0
            <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'category')->dropDownList(['' => ''] + ContentCategory::getLabels());
?>
        </div>
        <div class="col-md-5">
            <?php 
echo $form->field($model, 'publishTime')->widget(DateTimePicker::classname());
?>
            <?php 
echo $form->field($model, 'image')->widget(FileInput::className());
?>
            <?php 
echo $form->field($model, 'isPublished')->checkbox();
?>
        </div>
    </div>
    <?php 
echo $form->field($model, 'previewText')->widget(CKEditor::className());
?>
    <?php 
echo $form->field($model, 'text')->widget(CKEditor::className());
?>

    <div class="form-group">
        <?php 
 public function file($options = [])
 {
     $this->parts['{input}'] = FileInput::widget(['model' => $this->model, 'attribute' => $this->attribute, 'options' => $options]);
     return $this;
 }