Beispiel #1
0
    echo $form->field($model, 'text')->widget(CodemirrorWidget::class, ['preset' => 'javascript', 'assets' => [CodemirrorAsset::MODE_CLIKE, CodemirrorAsset::KEYMAP_EMACS, CodemirrorAsset::ADDON_EDIT_MATCHBRACKETS, CodemirrorAsset::ADDON_COMMENT, CodemirrorAsset::ADDON_DIALOG, CodemirrorAsset::ADDON_SEARCHCURSOR, CodemirrorAsset::ADDON_SEARCH], 'options' => ['rows' => 20], 'settings' => ['mode' => 'javascript']]);
} else {
    echo $form->field($model, 'text')->widget(TinyMce::class, ['clientOptions' => ['language' => 'ru', 'menubar' => false, 'height' => 500, 'image_dimensions' => false, 'apply_source_formatting' => false, 'verify_html' => false, 'plugins' => ['advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code contextmenu table paste insertdatetime'], 'toolbar' => 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code preview ']]);
}
?>

    <iframe id="form_target" name="form_target" style="display:none">
        <form id="my_form" action="/upload/" target="form_target" method="post" enctype="multipart/form-data"
              style="width:0px;height:0;overflow:hidden">
            <input name="image" type="file" onchange="$('#my_form').submit();this.value='';">
        </form>
    </iframe>


    <?php 
echo $form->field($model, 'NavTags')->widget(Select2::class, ['data' => $tags->getByType(2, 1), 'language' => 'en', 'options' => ['multiple' => true, 'placeholder' => 'Tags for navigation and seo'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <?php 
echo $form->field($model, 'SystemTags')->widget(Select2::class, ['data' => $tags->getByType(1, 1), 'language' => 'en', 'options' => ['multiple' => true, 'placeholder' => 'tags for locate item on page template'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <div class="form-group row">
        <div class="col-lg-2 small"><?php 
echo Yii::t('main', 'Date');
?>
</div>
        <?php 
echo $form->field($model, 'date', ['template' => '<div class="col-lg-5">{input}</div>', 'options' => ['class' => 'inline']])->widget(DateTimePicker::class);
?>
        <?php 
Beispiel #2
0
    <?php 
echo $form->field($model, 'text')->widget(TinyMce::class, ['clientOptions' => ['language' => 'ru', 'menubar' => false, 'height' => 500, 'image_dimensions' => false, 'apply_source_formatting' => false, 'verify_html' => false, 'plugins' => ['advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code contextmenu table paste insertdatetime'], 'toolbar' => 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code preview ']]);
?>

    <iframe id="form_target" name="form_target" style="display:none">
        <form id="my_form" action="/upload/" target="form_target" method="post" enctype="multipart/form-data"
              style="width:0px;height:0;overflow:hidden">
            <input name="image" type="file" onchange="$('#my_form').submit();this.value='';">
        </form>
    </iframe>


    <?php 
if (Yii::$app->controller->module->navigationTags) {
    echo $form->field($model, 'NavTags')->widget(Select2::class, ['data' => $tags->getByType(2, 1), 'language' => 'en', 'options' => ['multiple' => true, 'placeholder' => 'Tags for navigation'], 'pluginOptions' => ['allowClear' => true]]);
}
?>

    <?php 
if (Yii::$app->controller->module->positioning) {
    echo $form->field($model, 'SystemTags')->widget(Select2::class, ['data' => $tags->getByType(1, 1), 'language' => 'en', 'options' => ['multiple' => true, 'placeholder' => 'System tags like *main* *announce* e.t.c. '], 'pluginOptions' => ['allowClear' => true]]);
}
?>

    <div class="form-group row">
        <div class="col-lg-2 small"><?php 
echo Yii::t('main', 'Date');
?>
</div>