__construct() public method

Constructor
public __construct ( Zend\ServiceManager\ServiceManager $serviceManager, Zend\EventManager\EventManagerInterface $events = null, Zend\Stdlib\RequestInterface $request = null, Zend\Stdlib\ResponseInterface $response = null )
$serviceManager Zend\ServiceManager\ServiceManager
$events Zend\EventManager\EventManagerInterface
$request Zend\Stdlib\RequestInterface
$response Zend\Stdlib\ResponseInterface
示例#1
0
 public function __construct($configuration, ServiceManager $serviceManager)
 {
     parent::__construct($configuration, $serviceManager);
     $this->baseXMSEventManager = new EventManager();
     // shortcut the control lookup
     $this->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'));
     //TODO: moving to a dedicated function
     $this->serviceManager->setFactory('log', 'BaseXMS\\Log\\Factory');
     $this->serviceManager->setService('user', new \BaseXMS\User());
 }