|  |  |  | 
|---|
|  |  |  | $this->route = $this->getRoute(); | 
|---|
|  |  |  | //初始化redis | 
|---|
|  |  |  | $this->redis = System_Service_Locator::getInstance()->get('redis'); | 
|---|
|  |  |  | //if(!$this->redis->exists('modules') ){ | 
|---|
|  |  |  | $this->redis->set('modules', $this->getModules()); | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | //是否渲染模板 | 
|---|
|  |  |  | if(!empty($this->layout)){ | 
|---|
|  |  |  | //根据角色权限访问 | 
|---|
|  |  |  | 
|---|
|  |  |  | return $this->getRequest()->isXmlHttpRequest(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取栏目列表 | 
|---|
|  |  |  | * @return [type] [description] | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public function getModules(){ | 
|---|
|  |  |  | $this->module_service = new Service_Module(); | 
|---|
|  |  |  | return $this->module_service->getModuleList(array(), array(), array('level' => 1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|