New module integration problem in zf3

For programming and general questions on Zend Framework

New module integration problem in zf3

Postby amarbhanu on Fri Apr 14, 2017 4:23 pm

Module not found.
Index is working but Album module not working. any idea.

File:
D:\xampp\htdocs\mockadmin\module\Album\Module.php:45
Message:
Class 'Album\Controller\AlbumController' not found
Stack trace:
#0 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(747): Album\Module->Album\{closure}(Object(Zend\ServiceManager\ServiceManager), 'Album\\Controlle...', NULL)
#1 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(195): Zend\ServiceManager\ServiceManager->doCreate('Album\\Controlle...')
#2 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-servicemanager\src\AbstractPluginManager.php(143): Zend\ServiceManager\ServiceManager->get('Album\\Controlle...')
#3 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-mvc\src\DispatchListener.php(95): Zend\ServiceManager\AbstractPluginManager->get('Album\\Controlle...')
#4 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-eventmanager\src\EventManager.php(271): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-eventmanager\src\EventManager.php(151): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#6 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-mvc\src\Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#7 D:\xampp\htdocs\mockadmin\public\index.php(48): Zend\Mvc\Application->run()
#8 D:\xampp\htdocs\mockadmin\index.php(2): include('D:\\xampp\\htdocs...')


module.config.php have
'modules' => [
'Index',
'Album',
],
amarbhanu
 
Posts: 15
Joined: Mon May 11, 2009 2:45 pm

Re: New module integration problem in zf3

Postby amarbhanu on Sat Apr 15, 2017 7:49 pm

My first module index is working but second Module Album is not working please suggest me any have idea.

Module.php

Code: Select all
<?php

namespace Album;

use Zend\Db\Adapter\Adapter;
use Zend\Db\Adapter\AdapterInterface;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\ModuleManager\Feature\ConfigProviderInterface;

class Module implements ConfigProviderInterface
{
    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }
/**/
    public function getServiceConfig()
    {
        return [
            'factories' => [
                Model\AlbumTable::class        => function ($container) {
                    $tableGateway = $container->get('Model\AlbumTableGateway');

                    return new Model\AlbumTable($tableGateway);
                },
                'Model\AlbumTableGateway' => function ($container) {
                    $dbAdapter          = $container->get(AdapterInterface::class);
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new Model\Album());

                    return new TableGateway('album', $dbAdapter, null, $resultSetPrototype);
                },
            ],
        ];
    }
   
    public function getControllerConfig()
    {
      //die("Album:-Module".$container);

        return [
            'factories' => [
                Controller\AlbumController::class => function ($container) {
                    return new Controller\AlbumController(
                      //  $container->get(Model\AlbumTable::class)
                    );
                },
            ],
         
        ];
      
    }/**/
   
   public function getAutoloaderConfig()
   {
       return [
           'Zend\Loader\StandardAutoloader' => [
               'namespaces' => [
                   __NAMESPACE__ => __DIR__,
               ],
           ],
       ];
   }
}


An error occurred
An error occurred during execution; please try again later.
Additional information:
Error
File:
D:\xampp\htdocs\mockadmin\module\Album\Module.php:45
Message:
Class 'Album\Controller\AlbumController' not found
Stack trace:
#0 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(747): Album\Module->Album\{closure}(Object(Zend\ServiceManager\ServiceManager), 'Album\\Controlle...', NULL)
#1 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(195): Zend\ServiceManager\ServiceManager->doCreate('Album\\Controlle...')
#2 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-servicemanager\src\AbstractPluginManager.php(143): Zend\ServiceManager\ServiceManager->get('Album\\Controlle...')
#3 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-mvc\src\DispatchListener.php(95): Zend\ServiceManager\AbstractPluginManager->get('Album\\Controlle...')
#4 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-eventmanager\src\EventManager.php(271): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-eventmanager\src\EventManager.php(151): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#6 D:\xampp\htdocs\mockadmin\vendor\zendframework\zend-mvc\src\Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#7 D:\xampp\htdocs\mockadmin\public\index.php(48): Zend\Mvc\Application->run()
#8 D:\xampp\htdocs\mockadmin\index.php(2): include('D:\\xampp\\htdocs...')
#9 {main}
amarbhanu
 
Posts: 15
Joined: Mon May 11, 2009 2:45 pm

Re: New module integration problem in zf3

Postby amarbhanu on Sat Apr 29, 2017 8:53 pm

php composer.phar update then work
amarbhanu
 
Posts: 15
Joined: Mon May 11, 2009 2:45 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 5 guests