Ejemplo n.º 1
0
 /**
  * @return array
  */
 public function getFormConfig()
 {
     return ['label' => ['type' => ActiveFormBuilder::INPUT_TEXT, 'options' => ['maxlength' => true, 'class' => 's_name']], 'alias' => ['type' => ActiveFormBuilder::INPUT_TEXT, 'options' => ['maxlength' => true, 'class' => 's_alias']], 'category_id' => ['type' => ActiveFormBuilder::INPUT_DROPDOWN_LIST, 'items' => \common\models\ArticleCategory::getItems(), 'options' => ['prompt' => '']], 'announce' => ['type' => ActiveFormBuilder::INPUT_WIDGET, 'widgetClass' => \backend\components\ImperaviContent::className(), 'options' => ['model' => $this, 'attribute' => 'announce']], 'content' => ['type' => ActiveFormBuilder::INPUT_WIDGET, 'widgetClass' => \backend\components\ImperaviContent::className(), 'options' => ['model' => $this, 'attribute' => 'content']], 'date' => ['type' => ActiveFormBuilder::INPUT_WIDGET, 'widgetClass' => \metalguardian\dateTimePicker\Widget::className(), 'options' => ['mode' => \metalguardian\dateTimePicker\Widget::MODE_DATE, 'options' => ['class' => 'form-control']]], 'titleImage' => ['type' => ActiveFormBuilder::INPUT_RAW, 'value' => ImageUpload::widget(['model' => $this, 'attribute' => 'titleImage', 'saveAttribute' => EntityToFile::TYPE_ARTICLE_TITLE_IMAGE, 'multiple' => false, 'aspectRatio' => 848 / 350, 'uploadUrl' => ImagesUploadModel::uploadUrl(['model_name' => static::className(), 'attribute' => 'titleImage', 'entity_attribute' => EntityToFile::TYPE_ARTICLE_TITLE_IMAGE])])], 'tags' => ['type' => ActiveFormBuilder::INPUT_TEXT, 'options' => ['maxlength' => true]], 'views' => ['type' => ActiveFormBuilder::INPUT_TEXT], 'published' => ['type' => ActiveFormBuilder::INPUT_CHECKBOX], 'position' => ['type' => ActiveFormBuilder::INPUT_TEXT], 'sign' => ['type' => ActiveFormBuilder::INPUT_RAW, 'value' => Html::activeHiddenInput($this, 'sign')]];
 }