public function actionCreate($formid)
 {
     $model = new FormField();
     $model->formId = $formid;
     $model->setScenario('create');
     if ($model->load(Yii::$app->request->post(), 'FormField') && $model->validate()) {
         if (FormFieldService::create($model)) {
             $this->redirect(["all?formid={$formid}"]);
         }
     }
     return $this->render('@cmsgears/module-core/admin/views/form/field/create', ['model' => $model, 'formId' => $formid, 'typeMap' => FormField::$typeMap]);
 }
 public static function findByFormId($formId)
 {
     return FormField::findByFormId($formId);
 }
Exemple #3
0
 public static function findByFormId($formId)
 {
     $frmTable = FormTables::TABLE_FORM;
     return FormField::find()->joinWith('form')->where("{$frmTable}.id=:id", [':id' => $formId])->all();
 }
Exemple #4
0
 /**
  * @return array - array of FormField
  */
 public function getFields()
 {
     return $this->hasMany(FormField::className(), ['formId' => 'id']);
 }