예제 #1
0
 public function actionList()
 {
     $cond = new CDbCriteria();
     $cond->order = 'orderby asc';
     $cond->with = array('resource');
     $model = BasicModel::model()->findAll($cond);
     $rows = array();
     foreach ($model as $value) {
         $children = array();
         foreach ($value['resource'] as $val) {
             $children[] = array('text' => mb_convert_encoding($val->resourcename, 'UTF8', 'GBK'), 'id' => $val->resourceid, 'leaf' => TRUE);
         }
         $rows[] = array('text' => mb_convert_encoding($value->modelname, 'UTF8', 'GBK'), 'id' => $value->modelid, 'leaf' => FALSE, 'children' => $children);
     }
     echo json_encode($rows);
 }
예제 #2
0
파일: AreaBlock.php 프로젝트: rash012/cms
 /**
  * Returns the static model of the specified AR class.
  * @return AreaBlock the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }