renderForActiveForm() public method

Drawing form element
public renderForActiveForm ( ) : ActiveField
return yii\widgets\ActiveField
Beispiel #1
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     if ($this->fieldElement == self::FIELD_ELEMENT_SELECT) {
         $field = $this->activeForm->fieldSelect($this->model->relatedPropertiesModel, $this->property->code, ArrayHelper::map($this->property->enums, 'id', 'value'), []);
     } else {
         if ($this->fieldElement == self::FIELD_ELEMENT_SELECT_MULTI) {
             $field = $this->activeForm->fieldSelectMulti($this->model->relatedPropertiesModel, $this->property->code, ArrayHelper::map($this->property->enums, 'id', 'value'), []);
         } else {
             if ($this->fieldElement == self::FIELD_ELEMENT_RADIO_LIST) {
                 $field = parent::renderForActiveForm();
                 $field->radioList(ArrayHelper::map($this->property->enums, 'id', 'value'));
             } else {
                 if ($this->fieldElement == self::FIELD_ELEMENT_CHECKBOX_LIST) {
                     $field = parent::renderForActiveForm();
                     $field->checkboxList(ArrayHelper::map($this->property->enums, 'id', 'value'));
                 }
             }
         }
     }
     if (!$field) {
         return '';
     }
     $this->postFieldRender($field);
     return $field;
 }
Beispiel #2
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $find = CmsContentElement::find()->active();
     if ($this->content_id) {
         $find->andWhere(['content_id' => $this->content_id]);
     }
     if ($this->fieldElement == self::FIELD_ELEMENT_SELECT) {
         $field = $this->activeForm->fieldSelect($this->property->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []);
     } else {
         if ($this->fieldElement == self::FIELD_ELEMENT_SELECT_MULTI) {
             $field = $this->activeForm->fieldSelectMulti($this->property->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []);
         } else {
             if ($this->fieldElement == self::FIELD_ELEMENT_RADIO_LIST) {
                 $field = parent::renderForActiveForm();
                 $field->radioList(ArrayHelper::map($find->all(), 'id', 'name'));
             } else {
                 if ($this->fieldElement == self::FIELD_ELEMENT_CHECKBOX_LIST) {
                     $field = parent::renderForActiveForm();
                     $field->checkboxList(ArrayHelper::map($find->all(), 'id', 'name'));
                 }
             }
         }
     }
     if (!$field) {
         return '';
     }
     return $field;
 }
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $pluginOptions = ['showAlpha' => (bool) ($this->showAlpha === Cms::BOOL_Y), 'showInput' => (bool) ($this->showInput === Cms::BOOL_Y), 'showPalette' => (bool) ($this->showPalette === Cms::BOOL_Y)];
     $field->widget(ColorInput::className(), ['showDefaultPalette' => (bool) ($this->showDefaultPalette === Cms::BOOL_Y), 'useNative' => (bool) ($this->useNative === Cms::BOOL_Y), 'saveValueAs' => (string) $this->saveValueAs, 'pluginOptions' => $pluginOptions]);
     return $field;
 }
Beispiel #4
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     if (in_array($this->fieldElement, array_keys(self::fieldElements()))) {
         $fieldElement = $this->fieldElement;
         $field->{$fieldElement}(['rows' => $this->rows]);
     } else {
         $field->textInput([]);
     }
     return $field;
 }
Beispiel #5
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $find = CmsContentElement::find()->active();
     if ($this->content_id) {
         $find->andWhere(['content_id' => $this->content_id]);
     }
     if ($this->multiple == Cms::BOOL_N) {
         $field = $this->activeForm->fieldSelect($this->model->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []);
     } else {
         if ($this->multiple == Cms::BOOL_Y) {
             $field = $this->activeForm->fieldSelectMulti($this->model->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []);
         }
     }
     return $field;
 }
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $field->widget(\skeeks\cms\widgets\formInputs\comboText\ComboTextInputWidget::className(), ['ckeditorOptions' => ['relatedModel' => $this->model]]);
     return $field;
 }
Beispiel #7
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $field->widget(\skeeks\cms\widgets\formInputs\selectTree\SelectTree::className(), ["mode" => $this->isMultiple ? \skeeks\cms\widgets\formInputs\selectTree\SelectTree::MOD_MULTI : \skeeks\cms\widgets\formInputs\selectTree\SelectTree::MOD_SINGLE, "attributeSingle" => $this->property->code, "attributeMulti" => $this->property->code]);
     return $field;
 }
Beispiel #8
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $field->textInput();
     return $field;
 }
Beispiel #9
0
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $field->widget(\kartik\datecontrol\DateControl::classname(), ['type' => $this->type]);
     return $field;
 }
 /**
  * @return \yii\widgets\ActiveField
  */
 public function renderForActiveForm()
 {
     $field = parent::renderForActiveForm();
     $field->widget(\skeeks\cms\modules\admin\widgets\formInputs\OneImage::className(), ['filesModel' => $this->model]);
     return $field;
 }