public function loadModelUserGroup($id) { $model = sGroup::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function getGroupArray() { $models = sGroup::model()->findAll('parent_id = ' . Yii::app()->user->id); //Default Group as the first array $_items[] = $this->getGroup(); foreach ($models as $model) { $_items[] = $model->organization_root_id; } return $_items; }
<?php $this->widget('ext.bootstrap.widgets.BootGridView', array('id' => 's-group-grid', 'dataProvider' => sGroup::model()->search($model->id), 'itemsCssClass' => 'table table-striped table-bordered', 'template' => '{items}{pager}', 'columns' => array(array('class' => 'bootstrap.widgets.BootButtonColumn', 'template' => '{delete}', 'deleteButtonUrl' => 'Yii::app()->createUrl("sUser/deleteGroup",array("id"=>$data->id))'), 'organization_root.name'))); ?> <hr> <?php $this->renderPartial('_formGroup', array('model' => $modelGroup)); ?>