How to create module in zf3 Reviewed by Momizat on . Create new module (Admin) 1.create all structural folders and file Like Admin->src,view,controller,module.php etc 2.goto:-composer.json //Add these line [php] Create new module (Admin) 1.create all structural folders and file Like Admin->src,view,controller,module.php etc 2.goto:-composer.json //Add these line [php] Rating: 0

How to create module in zf3

Create new module (Admin)

  • 1.create all structural folders and file Like Admin->src,view,controller,module.php etc
  • 2.goto:-composer.json //Add these line

    "autoload": {
            "psr-4": {
                "Application\\": "module/Application/src/",
                "Album\\": "module/Album/src/",
                "Admin\\": "module/Admin/src/"
            }
        },
    
  • 3.Goto config/modules.config.php //Add these line

    'ZendDeveloperTools',
        'Application',
        'Album',
        'Admin'
    
  • 4.use command ->
    composer update
  • 5.Goto module/Admin/config/module.config.php //invoke controller

    'controllers' => [
            'factories' => [
            //Controller\AlbumController::class => InvokableFactory::class,
            ],
            'invokables' => array(
                'Admin\Controller\Index' => 'Admin\Controller\IndexController',
                
            ),
        ],
    
    'view_manager' => [
            'template_path_stack' => [
                'admin' => __DIR__ . '/../view',
            ],
        ],
    

Leave a Comment

© 2014 Powered By