Ejemplo n.º 1
0
    ?>

            <?php 
    $relation = Yii::$app->controller->module->relatedModel;
    ?>

            <?php 
    echo $form->field($model, 'related_id')->dropDownList($relation::forumRelationList(), ['prompt' => Yii::t('forum', 'Select related item')]);
    ?>

        <?php 
}
?>

        <?php 
echo $form->field($model, 'content')->widget(\worstinme\jodit\Editor::className(), ['settings' => ['enableDragAndDropFileToEditor' => new \yii\web\JsExpression("true"), 'uploader' => ['url' => \yii\helpers\Url::to(['upload-image', 'lang' => $this->context->lang]), 'data' => ['_csrf' => Yii::$app->request->csrfToken]], 'filebrowser' => ['ajax' => ['url' => \yii\helpers\Url::to(['file-browser', 'lang' => $this->context->lang]), 'data' => ['_csrf' => Yii::$app->request->csrfToken]], 'uploader' => ['url' => \yii\helpers\Url::to(['upload-image', 'lang' => $this->context->lang]), 'data' => ['_csrf' => Yii::$app->request->csrfToken]], 'createNewFolder' => false, 'deleteFolder' => false], 'buttons' => ['bold', 'italic', 'underline', '|', 'ul', 'ol', '|', 'image', '|', 'hr'], 'cleanHTML' => ['cleanOnPaste' => new \yii\web\JsExpression("true")]]]);
?>

        <div class="uk-form-row">
            <div class="uk-form-controls">
                <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('forum', 'Create') : Yii::t('forum', 'Update'), ['class' => $model->isNewRecord ? 'uk-button uk-button-success' : 'uk-button uk-button-primary']);
?>
            </div>
        </div>

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

    </div>
Ejemplo n.º 2
0
<?php

use yii\helpers\Html;
use worstinme\uikit\ActiveForm;
?>

<?php 
echo worstinme\uikit\Alert::widget(['type' => 'comment']);
?>

<div class="thread-reply">
    <?php 
$form = ActiveForm::begin(['layout' => 'stacked', 'field_width' => 'large', 'options' => ['data' => ['pjax' => true]]]);
?>

    <?php 
echo $form->field($model, 'content')->widget(\worstinme\jodit\Editor::className(), ['settings' => ['height' => '120px', 'enableDragAndDropFileToEditor' => true, 'uploader' => ['url' => \yii\helpers\Url::to(['upload-image', 'lang' => $this->context->lang]), 'data' => ['_csrf' => Yii::$app->request->csrfToken]], 'buttons' => ['bold', 'italic', 'underline', '|', 'ul', 'ol', '|', 'image']], 'options' => ['placeholder' => Yii::t('forum', 'Type your message here')]])->label(false);
?>

    <div class="uk-form-row">
        <?php 
echo Html::submitButton(Yii::t('forum', 'Send message'), ['class' => 'uk-button uk-button-success']);
?>
    </div>

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