示例#1
0
                    </div>


                </div>

                <?php 
echo $form->field($model, 'intro_text')->textarea(['rows' => 6]);
?>
        

                <div class="row">

                    <div class="col-lg-12 col-md-12 col-sm-12">
                        <?php 
echo $form->field($model, 'full_image')->widget(NewWidget::className(), ['uploadUrl' => Url::toRoute(['/blog/posts/uploadphoto']), 'previewUrl' => $model->module->ImagePathPreview, 'tempPreviewUrl' => $model->module->ImageTempPathPreview, 'KeyFolder' => $model->id, 'width' => 200, 'height' => 200]);
?>
                    </div>

                </div>
                <?php 
echo $form->field($model, 'full_text')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('blog/elfinder', [])]);
?>


                <?php 
//                echo
//                $form->field($model, 'full_text')->widget(\vova07\imperavi\Widget::className(), [
//
//                    'settings' => [
//                        //  'lang' => 'en',
use kartik\widgets\DatePicker;
use plathir\cropper\Widget as NewWidget;
use yii\helpers\Url;
?>

<p>Please fill out the following fields to update:</p>

<div class="row">
    <div class="col-lg-5">
        <?php 
$form = ActiveForm::begin(['id' => 'form-update', 'options' => ['enctype' => 'multipart/form-data']]);
?>
        <?php 
echo $profile->profile_image . '<br>';
//echo $form->field($profile, 'profile_image');
echo $form->field($profile, 'profile_image')->widget(NewWidget::className(), ['uploadUrl' => Url::toRoute(['/user/user-profile/uploadphoto']), 'previewUrl' => $profile->module->ProfileImagePathPreview, 'tempPreviewUrl' => $profile->module->ProfileImageTempPathPreview, 'width' => 200, 'height' => 200]);
?>

        <?php 
echo $form->field($profile, 'first_name');
?>
        <?php 
echo $form->field($profile, 'last_name');
?>
        <?php 
echo $form->field($profile, 'gender')->dropDownList(['1' => 'Male', '2' => 'Female']);
?>
        <?php 
echo $form->field($profile, 'birth_date')->widget(DatePicker::classname(), ['options' => ['placeholder' => 'Enter birth date ...'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy/mm/dd']]);
?>
        <div class="form-group">
示例#3
0
<div class="comics-form">

    <?php 
$form = ActiveForm::begin();
?>

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

    <?php 
echo $form->field($model, 'descr')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'cover_page')->widget(NewWidget::className(), ['uploadUrl' => Url::toRoute(['uploadphoto']), 'previewUrl' => $model->module->ComicsPathPreview, 'tempPreviewUrl' => $model->module->ComicsTempPathPreview, 'KeyFolder' => $model->id, 'width' => 600, 'height' => 800, 'maxSize' => 10145728]);
?>
    <?php 
echo $form->field($model, 'comic_pages')->widget(UplWidget::className(), ['uploadUrl' => Url::toRoute(['uploadfile']), 'previewUrl' => $model->module->ComicsPathPreview, 'tempPreviewUrl' => $model->module->ComicsTempPathPreview, 'KeyFolder' => $model->id, 'galleryType' => true]);
?>


<?php 
echo $form->field($model, 'created_at')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATETIME, 'ajaxConversion' => true, 'saveFormat' => 'php:U', 'options' => ['layout' => '{picker}{input}', 'pluginOptions' => ['autoclose' => true, 'todayBtn' => true]]]);
?>
    <?php 
echo $form->field($model, 'updated_at')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATETIME, 'ajaxConversion' => true, 'saveFormat' => 'php:U', 'options' => ['layout' => '{picker}{input}', 'pluginOptions' => ['autoclose' => true, 'todayBtn' => true]]]);
?>
    <div class="form-group">
    <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);