/**
  * @inheritdoc
  */
 public function init()
 {
     Widget::registerTranslations();
     if ($this->temp_path === null) {
         throw new InvalidConfigException(Yii::t('upload', 'MISSING_ATTRIBUTE', ['attribute' => 'temp_path']));
     } else {
         $this->temp_path = rtrim(Yii::getAlias($this->temp_path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
     }
 }
Ejemplo n.º 2
0
?>
                <?php 
echo $form->field($model, 'category')->widget(TreeViewInput::className(), ['model' => $model, 'attribute' => 'category', 'query' => Category::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Categories'], 'asDropdown' => true, 'multiple' => false, 'showInactive' => true, 'fontAwesome' => true, 'rootOptions' => ['label' => '<i class="fa fa-tree"></i>', 'class' => 'text-success']]);
?>

                <?php 
echo $form->field($model, 'tags')->widget(SelectizeTextInput::className(), ['loadUrl' => ['/blog/posts/tagslist'], 'options' => ['class' => 'form-control'], 'clientOptions' => ['plugins' => ['remove_button'], 'valueField' => 'tags', 'labelField' => 'tags', 'searchField' => ['tags'], 'create' => true]]);
?>
                <div class="row-fluid">
                    <?php 
echo $form->field($model, 'attachments')->widget(UplWidget::className(), ['uploadUrl' => Url::toRoute(['/blog/posts/uploadfile']), 'previewUrl' => $model->module->ImagePathPreview, 'tempPreviewUrl' => $model->module->ImageTempPathPreview, 'KeyFolder' => $model->id]);
?>
                </div>
                <div class="row-fluid">
                    <?php 
echo $form->field($model, 'gallery')->widget(UplWidget::className(), ['uploadUrl' => Url::toRoute(['/blog/posts/uploadfile']), 'previewUrl' => $model->module->ImagePathPreview, 'tempPreviewUrl' => $model->module->ImageTempPathPreview, 'KeyFolder' => $model->id, 'galleryType' => true]);
?>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-3">
                <div class="panel panel-info">
                    <!-- Default panel contents -->
                    <div class="panel-heading">Post Infos</div>
                    <div class="panel-body">
                        <?php 
echo $form->field($model, 'publish')->widget(SwitchInput::classname(), []);
?>

                        <?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]]]);
?>
Ejemplo n.º 3
0
$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']);
?>
    </div>