$model = M('Model')->getByName($model); } public function listRow(){ return empty($this->$model['list_row'])?10:$this->$model['list_row']; } } class listRowEvent extends Controller{ private $items; public function getItem($item_name,$modelName="Model") { try { //$class=new ReflectionClass($item_name); //$this->item=$class->newInstance(); switch($item_name){ case "global": $this->items = new \Admin\Event\listRowGlobalController(); break; case "item": $this->items = new listRowItemController($modelName); break; default: $this->items = new listRowGlobalController(); break; } } catch(\Exception $e) { return $e->getMessage(); } } public function listRows() { return $this->items->listRow(); } }