/** * will create a new commment * @param integer $id [description] * @param integer $module [description] * @return [type] [description] */ public function actionAddlocation($module = NULL, $id = NULL) { $model = new WidgetConfig(); if ($model->load(Yii::$app->request->post()) && $model->save()) { $query = WidgetConfig::findRelatedRecords('MAPWIDGET', $model->wgt_table, $model->wgt_id); $dpLocations = new ActiveDataProvider(array('query' => $query)); return $this->renderAjax('@frenzelgmbh/sblog/widgets/views/_mapwidget', ['dpLocations' => $dpLocations, 'module' => $model->wgt_table, 'id' => $model->wgt_id]); } else { $model->wgt_id = $id; $model->wgt_table = $module; $model->name = 'MAPWIDGET'; return $this->renderAjax('_form_addlocation', array('model' => $model)); } }
public function run() { $query = WidgetConfig::findRelatedRecords(self::WIDGET_NAME, $this->module, $this->id); $dpPictures = new ActiveDataProvider(array('query' => $query)); return $this->render('@frenzelgmbh/sblog/widgets/views/_picture_link_widget', ['dpPictures' => $dpPictures, 'module' => $this->module, 'id' => $this->id]); }