Exemple #1
0
    <?php 
$form = ActiveForm::begin(['layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'app_name')->textInput();
?>
    <?php 
echo $form->field($model, 'app_logo')->fileInput();
if ($model->app_logo) {
    echo "<div class='form-group'><div class='col-sm-offset-3 col-sm-9'>";
    echo Html::img('/uploads/settings/app_logo/' . $model->app_logo, ['class' => 'img-thumbnail', 'width' => 150]);
    echo "</div></div>";
}
?>
    <?php 
echo $form->field($model, 'app_description')->widget(Widget::classname(), ['settings' => ['lang' => 'ru', 'minHeight' => 300, 'pastePlainText' => true, 'buttonSource' => true, 'plugins' => ['clips', 'fullscreen']]]);
?>

    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-9">
            <?php 
echo Html::submitButton(\Yii::t('app', 'Save'), ['class' => 'btn btn-primary']);
?>
        </div>
    </div>

    <?php 
ActiveForm::end();
?>
</div>
Exemple #2
0
            <?php 
echo $form->field($model, 'source_title')->widget(\yii\jui\AutoComplete::className(), ['clientOptions' => ['source' => $data, 'minLength' => '3', 'autoFill' => true], 'options' => ['class' => 'form-control']]);
?>
            <?php 
if (!$redactor) {
    ?>
                <?php 
    echo $form->field($model, 'body')->textarea(['rows' => 5, 'cols' => 5, 'id' => 'my-textarea-id']);
    ?>
            <?php 
} else {
    ?>

            <?php 
    echo $form->field($model, 'body')->widget(Widget::classname(), ['settings' => ['lang' => 'ru', 'minHeight' => 300, 'pastePlainText' => true, 'buttonSource' => true, 'plugins' => ['clips', 'fullscreen'], 'imageUpload' => Url::to(['/articles/image-upload'])]]);
    ?>

            <?php 
}
?>


            <div class="form-group">
                <?php 
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Обновить', ['class' => 'btn btn-primary', 'name' => 'create-button']);
?>
            </div>

            <?php 
ActiveForm::end();
Exemple #3
0
<div class="owner-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

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

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

    <?php 
echo $form->field($model, 'description')->widget(Widget::classname(), ['settings' => ['lang' => 'ru', 'minHeight' => 300, 'pastePlainText' => true, 'buttonSource' => true, 'plugins' => ['clips'], 'imageUpload' => Url::to(['/owner/image-upload'])]]);
?>
    <?php 
echo $form->field($model, 'imageOwner')->fileInput();
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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