sathyashrayan

/module/Blog/config/module.config.php

Jul 2nd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2. // In /module/Blog/config/module.config.php:
  3. namespace Blog;
  4. use Zend\ServiceManager\Factory\InvokableFactory;
  5.  
  6.  
  7.  
  8.  
  9. return [
  10.         // This lines opens the configuration for the RouteManager
  11.         'router' => [
  12.                 // Open configuration for all possible routes
  13.                 'routes' => [
  14.                         // Define a new route called "blog"
  15.                         'blog' => [
  16.                                 // Define a "literal" route type:
  17.                                 'type' => 'literal',
  18.                                 // Configure the route itself
  19.                                 'options' => [
  20.                                         // Listen to "/blog" as uri:
  21.                                         'route'    => '/blog',
  22.                                         // Define default controller and action to be called when
  23.                                         // this route is matched
  24.                                         'defaults' => [
  25.                                                 'controller' => Controller\ListController::class,
  26.                                                 'action'     => 'index',
  27.                                         ],
  28.                                 ],
  29.                         ],
  30.                 ],
  31.         ],
  32.        
  33.         'controllers' => [
  34.                 'factories' => [
  35.                         Controller\ListController::class => Factory\ListControllerFactory::class,
  36.                 ],
  37.         ],
  38.        
  39.         'service_manager' => [
  40.                 'aliases' => [
  41.                         //Model\PostRepositoryInterface::class => Model\PostRepository::class,
  42.                         Model\PostRepositoryInterface::class => Mapper\ZendDbSqlRepository::class,
  43.                 ],
  44.                 'factories' => [
  45.                         Model\PostRepository::class => InvokableFactory::class,
  46.                         Mapper\ZendDbSqlRepository::class => Factory\ZendDbSqlRepositoryFactory::class,
  47.                        
  48.                        
  49.                        
  50.                 ],
  51.         ],
  52.        
  53.         'view_manager' => [
  54.                 'template_path_stack' => [
  55.                         __DIR__ . '/../view',
  56.                 ],
  57.         ],
  58.        
  59.         'db' => [
  60.                 'driver' => 'Pdo',
  61.                 'username' => 'root',
  62.                 'password' => 'Adminadmin@123',
  63.                 'dsn' => 'mysql:dbname=test_zf3;host=localhost',
  64.                 'driver_options' => [
  65.                         \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
  66.                 ],
  67.                
  68.         ]
  69.        
  70. ];
Add Comment
Please, Sign In to add comment