Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // In /module/Blog/config/module.config.php:
- namespace Blog;
- use Zend\ServiceManager\Factory\InvokableFactory;
- return [
- // This lines opens the configuration for the RouteManager
- 'router' => [
- // Open configuration for all possible routes
- 'routes' => [
- // Define a new route called "blog"
- 'blog' => [
- // Define a "literal" route type:
- 'type' => 'literal',
- // Configure the route itself
- 'options' => [
- // Listen to "/blog" as uri:
- 'route' => '/blog',
- // Define default controller and action to be called when
- // this route is matched
- 'defaults' => [
- 'controller' => Controller\ListController::class,
- 'action' => 'index',
- ],
- ],
- ],
- ],
- ],
- 'controllers' => [
- 'factories' => [
- Controller\ListController::class => Factory\ListControllerFactory::class,
- ],
- ],
- 'service_manager' => [
- 'aliases' => [
- //Model\PostRepositoryInterface::class => Model\PostRepository::class,
- Model\PostRepositoryInterface::class => Mapper\ZendDbSqlRepository::class,
- ],
- 'factories' => [
- Model\PostRepository::class => InvokableFactory::class,
- Mapper\ZendDbSqlRepository::class => Factory\ZendDbSqlRepositoryFactory::class,
- ],
- ],
- 'view_manager' => [
- 'template_path_stack' => [
- __DIR__ . '/../view',
- ],
- ],
- 'db' => [
- 'driver' => 'Pdo',
- 'username' => 'root',
- 'password' => 'Adminadmin@123',
- 'dsn' => 'mysql:dbname=test_zf3;host=localhost',
- 'driver_options' => [
- \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
- ],
- ]
- ];
Add Comment
Please, Sign In to add comment