Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Application;
- use Zend\Mvc\ModuleRouteListener;
- use Zend\Mvc\MvcEvent;
- class Module
- {
- public function getConfig()
- {
- return array(
- 'router' => array(
- 'routes' => array(
- // Standard stuff
- 'home' => array(
- 'type' => 'Segment',
- 'options' => array(
- 'route' => '/',
- 'defaults' => array(
- 'controller' => 'Application\Controller\Index',
- 'action' => 'index',
- ),
- ),
- ),
- // Resful API, i.e. /api/1.0/Users.json/4
- 'api' => array(
- 'type' => 'Segment',
- 'options' => array(
- 'route' => '/api/1.0',
- ),
- 'may_terminate' => true,
- 'child_routes' => array(
- 'default' => array(
- 'type' => 'Segment',
- 'options' => array(
- 'route' => '/:formatter/:controller[/:action]',
- 'constraints' => array(
- 'formatter' => '[a-zA-Z][a-zA-Z0-9_-]*',
- 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
- 'id' => '[a-zA-Z0-9_-]*'
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- 'service_manager' => array(
- 'factories' => array(
- 'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
- ),
- ),
- 'translator' => array(
- 'locale' => 'en_US',
- 'translation_file_patterns' => array(
- array(
- 'type' => 'gettext',
- 'base_dir' => __DIR__ . '/../language',
- 'pattern' => '%s.mo',
- ),
- ),
- ),
- 'controllers' => array(
- 'invokables' => array(
- 'Application\Controller\Users' => 'Application\Controller\Users',
- 'Application\Controller\Index' => 'Application\Controller\Index'
- ),
- ),
- 'view_manager' => array(
- 'display_not_found_reason' => true,
- 'display_exceptions' => true,
- 'doctype' => 'HTML5',
- 'not_found_template' => 'error/404',
- 'exception_template' => 'error/index',
- 'template_map' => array(
- 'layout/layout' => __DIR__ . '/view/layout/layout.phtml',
- 'application/index/index' => __DIR__ . '/view/application/index/index.phtml',
- 'error/404' => __DIR__ . '/view/error/404.phtml',
- 'error/index' => __DIR__ . '/view/error/index.phtml',
- ),
- 'template_path_stack' => array(
- __DIR__ . '/../view',
- ),
- 'strategies' => array(
- 'ViewJsonStrategy',
- ),
- ),
- );
- }
- public function getAutoloaderConfig()
- {
- return array(
- 'Zend\Loader\StandardAutoloader' => array(
- 'namespaces' => array(
- __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
- ),
- ),
- );
- }
- }
Add Comment
Please, Sign In to add comment