Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
- * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
- namespace Application;
- use Zend\Mvc\ModuleRouteListener;
- use Zend\Mvc\MvcEvent;
- use ZF\Apigility\Provider\ApigilityProviderInterface;
- class Module implements ApigilityProviderInterface
- {
- public function onBootstrap(MvcEvent $e)
- {
- $eventManager = $e->getApplication()->getEventManager();
- $moduleRouteListener = new ModuleRouteListener();
- $moduleRouteListener->attach($eventManager);
- }
- public function getConfig()
- {
- return include __DIR__ . '/config/module.config.php';
- }
- public function getAutoloaderConfig()
- {
- // var_dump(array(__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,));
- return array(
- 'Zend\Loader\StandardAutoloader' => array(
- 'namespaces' => array(
- __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
- __NAMESPACE__ => __DIR__ . '/test/' . __NAMESPACE__,
- ),
- ),
- );
- }
- public function getServiceConfig()
- {
- return array(
- 'factories' => array(
- 'UserService' => function($sm){
- $em = $sm->get('Doctrine\ORM\EntityManager');
- return new \Application\Service\UserService($sm,$em);
- }
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement