PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/module/Application/config/module.config.php

https://bitbucket.org/phaikawl/pknewsboard
PHP | 169 lines | 155 code | 3 blank | 11 comment | 0 complexity | a86cf32bfb50681b9944a15e02f3b65d MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework (http://framework.zend.com/)
  4. *
  5. * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
  6. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  7. * @license http://framework.zend.com/license/new-bsd New BSD License
  8. */
  9. namespace Application;
  10. return array(
  11. 'router' => array(
  12. 'routes' => array(
  13. 'home' => array(
  14. 'type' => 'Zend\Mvc\Router\Http\Literal',
  15. 'options' => array(
  16. 'route' => '/',
  17. 'defaults' => array(
  18. 'controller' => 'Application\Controller\Index',
  19. 'action' => 'index',
  20. ),
  21. ),
  22. ),
  23. // The following is a route to simplify getting started creating
  24. // new controllers and actions without needing to create a new
  25. // module. Simply drop new controllers in, and you can access them
  26. // using the path /application/:controller/:action
  27. 'application' => array(
  28. 'type' => 'Literal',
  29. 'options' => array(
  30. 'route' => '/application',
  31. 'defaults' => array(
  32. '__NAMESPACE__' => 'Application\Controller',
  33. 'controller' => 'Index',
  34. 'action' => 'index',
  35. ),
  36. ),
  37. 'may_terminate' => true,
  38. 'child_routes' => array(
  39. 'default' => array(
  40. 'type' => 'Segment',
  41. 'options' => array(
  42. 'route' => '/[:controller[/:action]]',
  43. 'constraints' => array(
  44. 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
  45. 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
  46. ),
  47. 'defaults' => array(
  48. ),
  49. ),
  50. ),
  51. ),
  52. ),
  53. 'article' => array(
  54. 'type' => 'Literal',
  55. 'options' => array(
  56. 'route' => '/article',
  57. 'defaults' => array(
  58. '__NAMESPACE__' => 'Application\Controller',
  59. 'controller' => 'Article',
  60. 'action' => 'index',
  61. ),
  62. ),
  63. 'may_terminate' => true,
  64. 'child_routes' => array(
  65. 'default' => array(
  66. 'type' => 'Segment',
  67. 'options' => array(
  68. 'route' => '/[:action]',
  69. 'constraints' => array(
  70. 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
  71. ),
  72. 'defaults' => array(
  73. ),
  74. ),
  75. ),
  76. ),
  77. ),
  78. 'subcom' => array(
  79. 'type' => 'Literal',
  80. 'options' => array(
  81. 'route' => '/subcom',
  82. 'defaults' => array(
  83. '__NAMESPACE__' => 'Application\Controller',
  84. 'controller' => 'Subcom',
  85. 'action' => 'new',
  86. ),
  87. ),
  88. 'may_terminate' => true,
  89. 'child_routes' => array(
  90. 'default' => array(
  91. 'type' => 'Segment',
  92. 'options' => array(
  93. 'route' => '/[:action]',
  94. 'constraints' => array(
  95. 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
  96. ),
  97. 'defaults' => array(
  98. ),
  99. ),
  100. ),
  101. ),
  102. ),
  103. ),
  104. ),
  105. 'service_manager' => array(
  106. 'factories' => array(
  107. 'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
  108. ),
  109. 'aliases' => array(
  110. 'dmservice' => 'doctrine.documentmanager.odm_default',
  111. ),
  112. ),
  113. 'translator' => array(
  114. 'locale' => 'en_US',
  115. 'translation_file_patterns' => array(
  116. array(
  117. 'type' => 'gettext',
  118. 'base_dir' => __DIR__ . '/../language',
  119. 'pattern' => '%s.mo',
  120. ),
  121. ),
  122. ),
  123. 'controllers' => array(
  124. 'invokables' => array(
  125. 'Application\Controller\Index' => 'Application\Controller\IndexController',
  126. 'Application\Controller\Article' => 'Application\Controller\ArticleController',
  127. 'Application\Controller\Subcom' => 'Application\Controller\SubcomController',
  128. ),
  129. ),
  130. 'view_manager' => array(
  131. 'display_not_found_reason' => true,
  132. 'display_exceptions' => true,
  133. 'doctype' => 'HTML5',
  134. 'not_found_template' => 'error/404',
  135. 'exception_template' => 'error/index',
  136. 'template_map' => array(
  137. 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
  138. 'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
  139. 'application/article/new' => __DIR__ . '/../view/application/article/new.phtml',
  140. 'error/404' => __DIR__ . '/../view/error/404.phtml',
  141. 'error/index' => __DIR__ . '/../view/error/index.phtml',
  142. ),
  143. 'template_path_stack' => array(
  144. __DIR__ . '/../view',
  145. ),
  146. ),
  147. 'doctrine' => array(
  148. 'driver' => array(
  149. __NAMESPACE__ . '_driver' => array(
  150. 'class' => 'Doctrine\ODM\CouchDB\Mapping\Driver\AnnotationDriver',
  151. 'cache' => 'array',
  152. 'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Document')
  153. ),
  154. 'zfcuser_xml' => array(
  155. 'class' => 'Doctrine\ODM\CouchDB\Mapping\Driver\XmlDriver',
  156. 'paths' => array(__DIR__ . '/xml'),
  157. ),
  158. 'odm_default' => array(
  159. 'drivers' => array(
  160. __NAMESPACE__ . '\Document' => __NAMESPACE__ . '_driver',
  161. __NAMESPACE__ . '\XmlDocument' => 'zfcuser_xml'
  162. )
  163. )
  164. ),
  165. ),
  166. );