public function getRealName() { $this->getIdentity(); $sm = ServiceLocatorFactory::getInstance(); $this->loginTable = $sm->get('Application\\Model\\LoginTable'); $real_name = $this->loginTable->getLogin($this->identity)->real_name; return $real_name; }
public function onBootstrap(MvcEvent $e) { $eventManager = $e->getApplication()->getEventManager(); $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); $sm = $e->getApplication()->getServiceManager(); \Application\ServiceLocatorFactory::setInstance($sm); // $app = $e->getApplication(); // $app->getEventManager()->attach( // 'route', // function($e) // { // $app = $e->getApplication(); // $routeMatch = $e->getRouteMatch(); // $sm = $app->getServiceManager(); // // } // // // ); }