controllers/WidgetconfigController.php
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 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 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 , ) ) ; } }
will create a new commment
@param  integer $id     [description]
@param  integer $module [description]
@return [type]         [description]
will create a new commment