public function runLayout($position) { $route = $this->module->id . "/" . $this->id . "/" . $this->action->id; $layout = SystemLayouts::model()->orderById()->find(':route LIKE route', array(':route' => $route)); $layoutWidgets = SystemLayoutsWidgets::model()->sort()->findAll('layout_id = :layout_id AND position = :position', array(':layout_id' => $layout->id, ':position' => $position)); foreach ($layoutWidgets as $layoutWidget) { $widget = $layoutWidget->widget; if ($widget) { $this->widget($widget->class, $widget->getParams()); } } }
/** * Delete language */ public function actionDelete() { if (Yii::app()->request->isPostRequest) { $model = SystemLayouts::model()->findAllByPk($_REQUEST['id']); if (!empty($model)) { foreach ($model as $page) { $page->delete(); } } if (!Yii::app()->request->isAjaxRequest) { $this->redirect('index'); } } }