Advertisement
mOrloff

module.config.php

Apr 2nd, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.50 KB | None | 0 0
  1. <?php    // see lines 8/9 & 14/15
  2. return array(
  3.     'di' => array(
  4.         'instance' => array(
  5.  
  6.             'Bom\Controller\BomController' => array(
  7.                 'parameters' => array(
  8.                     'bomTable' => 'Bom\Model\DbTable\BomTable',  // TODO: **** Move data table gateway
  9.                     //'bomTable' => 'Bom\Model\BomTable',
  10.                     'contactTable' => 'Company\Model\ContactTable',
  11.                     'companyTable' => 'Company\Model\CompanyTable',
  12.                 ),
  13.             ),
  14.             'Bom\Model\DbTable\BomTable' => array(  // TODO: **** Move data table gateway
  15.             //'Bom\Model\BomTable' => array(
  16.                 'parameters' => array(
  17.                     'adapter' => 'Zend\Db\Adapter\Adapter',
  18.                 )
  19.             ),
  20.  
  21.             'Zend\View\Resolver\TemplatePathStack' => array(
  22.                 'parameters' => array(
  23.                     'paths'  => array(
  24.                         'Bom' => __DIR__ . '/../view',
  25.                     ),
  26.                 ),
  27.             ),
  28.  
  29.             'Zend\Db\Adapter\Adapter' => array(
  30.                 'parameters'=>array(
  31.                     'driver' => array(
  32.                         'driver' => 'Pdo',
  33.                         'dsn' => 'mysql:dbname=db;hostname=localhost',
  34.                         'username' => 'uid',
  35.                         'password' => 'pass',
  36.                         'driver_options' => array(  
  37.                             PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''),
  38.                     ),
  39.                 )
  40.             ),
  41.  
  42.             //ROUTES
  43.             'Zend\Mvc\Router\RouteStack'=>array( 'parameters'=>array(
  44.                 'routes' => array(            
  45.                     // route to company controller
  46.                     'bom' => array(  // this key-name for the array is totally arbitrary
  47.                         'type' => 'Segment',
  48.                         'options' => array(
  49.                             'route'    => '/bom[/:action]',
  50.                             'constraints' => array(
  51.                                 'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
  52.                             ),
  53.                             'defaults' => array(
  54.                                 'controller' => 'Bom\Controller\BomController',
  55.                                 'action' => 'index',
  56.                             ),
  57.                         ),
  58.                     ),
  59.                 ),              
  60.             )),  // END ROUTES  
  61.  
  62.         ),
  63.     ),
  64. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement