Beispiel #1
0
    <?php 
$form = ActiveForm::begin(['action' => ['save']]);
?>

    <?php 
echo $form->field($model, 'title')->textInput();
?>

    <?php 
/*echo $form->field($model, 'content')->widget(\yii\redactor\widgets\Redactor::className(), [
      'clientOptions' => [
          'lang' => 'ru',
          'plugins' => ['fontcolor', /*'imagemanager', 'table']
      ]
  ])*/
echo $form->field($model, 'content', [])->widget(\app\modules\redactor\widgets\Redactor::className(), ['clientOptions' => ['lang' => 'ru', 'plugins' => ['fontcolor', 'imagemanager', 'table', 'linkinternal'], 'minHeight' => 400, 'imageUpload' => Url::to(['/redactor/upload/image', 'table' => 0, 'id' => 0]), 'imageManagerJson' => Url::to(['/redactor/upload/image-json', 'table' => 0, 'id' => 0]), 'fileUploadParam' => 'files', 'imageUploadParam' => 'files', 'linkExplorer' => Url::to(['explore/expand'])]])->label(false);
?>
    <?php 
/*        echo $form->field($model, 'content')->widget(CKEditor::className(), [
            'options' => ['rows' => 6],
            'preset' => 'custom',
            'clientOptions' => [
                'height' => 200,
                'toolbar' => [
                    [ 'name' => 'clipboard', 'items' => [ 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo' ] ],
                    [ 'name' => 'links', 'items' => [ 'Link', 'Unlink'] ],
                    [ 'name' => 'insert', 'items' => [ 'Glyphicons', 'Image', 'Table', 'HorizontalRule', 'SpecialChar', 'Youtube', 'Slideshow' ] ],
                    [ 'name' => 'tools', 'items' => [ 'Maximize' ] ],
                    [ 'name' => 'document', 'items' => [ 'Source' ] ],
                    '/',
                    [ 'name' => 'basicstyles', 'items' => [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] ],
Beispiel #2
0
?>

    <?php 
echo $form->field($model, 'title')->widget(transliterator::className(), ['targetAttribute' => 'alias']);
?>

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

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

    <?php 
echo $form->field($model, 'content', ['horizontalCssClasses' => ['wrapper' => 'col-sm-10', 'error' => '', 'hint' => 'col-sm-3'], 'template' => '{input}{error}{hint}'])->widget(\app\modules\redactor\widgets\Redactor::className(), ['clientOptions' => ['lang' => 'ru', 'plugins' => ['fontcolor', 'imagemanager', 'table']]]);
?>

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

    <div class="form-group">
        <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('Отмена', ['list', 'id' => $model->category_id], ['class' => 'btn btn-default']);
?>
    </div>