Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created November 4, 2012 13:56
Show Gist options
  • Select an option

  • Save eminetto/4012030 to your computer and use it in GitHub Desktop.

Select an option

Save eminetto/4012030 to your computer and use it in GitHub Desktop.
<?php
// module/Admin/config/module.config.php:
return array(
'controllers' => array( //add module controllers
'invokables' => array(
'Admin\Controller\Index' => 'Admin\Controller\IndexController',
),
),
'router' => array(
'routes' => array(
'admin' => array(
'type' => 'Literal',
'options' => array(
'route' => '/admin',
'defaults' => array(
'__NAMESPACE__' => 'Admin\Controller',
'controller' => 'Index',
'action' => 'index',
'module' => 'admin'
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
'child_routes' => array( //permite mandar dados pela url
'wildcard' => array(
'type' => 'Wildcard'
),
),
),
),
),
),
),
'view_manager' => array( //the module can have a specific layout
// 'template_map' => array(
// 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
// ),
'template_path_stack' => array(
'admin' => __DIR__ . '/../view',
),
),
// 'db' => array( //module can have a specific db configuration
// 'driver' => 'PDO_SQLite',
// 'dsn' => 'sqlite:' . __DIR__ .'/../data/admin.db',
// 'driver_options' => array(
// PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
// )
// )
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment