public static function getModelWidgets($modelClass, $current_page = 'all', $page_size = 10) { $models = static::getModels($modelClass, $current_page, $page_size); $widgets = ''; foreach ($models as $model) { $widgets .= ItemWidget::widget(['model' => $model, 'action' => static::getRouteUpdate()]); } return $widgets; }
public function actionWidgetList() { $widgets = ""; $items = $this->actionList(); foreach ($items as $item) { $widgets .= ItemWidget::widget(['model' => $item, 'action' => static::getRouteUpdate(), 'delete' => static::getRouteDelete()]); } if (empty($widgets)) { $widgets = "There's no any items. You can click above button to add a new one."; } return $widgets; }