/**
  * Factory method.
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return SubjectController
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $ctr = new SubjectController();
     $ctr->setEntityManager($serviceLocator->getServiceLocator()->get('Doctrine\\ORM\\EntityManager'));
     $ctr->setSubjectService($serviceLocator->getServiceLocator()->get('SubjectService'));
     return $ctr;
 }
 public function index()
 {
     $id = I('get.id', '1');
     $node = D('node');
     $nodeName = $node->where(array('id' => $id))->getField('cname');
     $list = $node->where(array('pid' => $id))->select();
     SubjectController::DG_getList($list);
     $this->assign('nodeName', $nodeName);
     $this->assign('list', $list);
     $this->assign('left', 'Blocks/left');
     $this->assign('url', "lists");
     session('nodeId', $id);
     //初始化实用
     $this->display("Index/index");
 }