public function run() { $dpLocations = WidgetConfig::findRelatedModels(self::WIDGET_NAME, $this->module, $this->id); if (!is_null($dpLocations)) { return $this->render('@frenzelgmbh/sblog/widgets/views/_mapwidget_renderer', ['dpLocations' => $dpLocations]); } else { return ""; } }
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]); }
/** * Finds the Post model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return WidgetConfig the loaded model * @throws HttpException if the model cannot be found */ protected function findModel($id) { if (($model = WidgetConfig::findOne($id)) !== null) { return $model; } else { throw new HttpException(404, 'The requested page does not exist.'); } }