I’m newbie in Zend Framework 2. I created the folder structure and paste the code snippets from this page http://framework.zend.com/manual/2.0/en/user-guide/routing-and-controllers.html about routing in Zend Framework 2.
I get the following error:
( ! ) Fatal error: Class 'Album\Controller\AlbumController' not found in C:\wamp\www\zend\vendor\zendframework\zendframework\library\Zend\ServiceManager\AbstractPluginManager.php on line 178
Below is my classmap_autoload.php
<?php
return array();
Below is the Module.php
namespace Album;
class Module {
public function getAutoloaderConfig(){
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__.'/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespace' => array(
__NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__,
),
),
);
}
public function getConfig(){
return include __DIR__.'/config/module.config.php';
}
}
I have my AlbumController class already in the module/Album/

Here is my module.config.php from the Album module:
<?php
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
),
),
);
AlbumCOntroller.php
<?php
namespace Album\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class AlbumController extends AbstractActionController
{
public function indexAction()
{
}
public function addAction()
{
}
public function editAction()
{
}
public function deleteAction()
{
}
}
I have no idea why I have such an error.. I would like to learn what is happening inside Zend before rendering a page but before I intend to solve this problem ..
How can I fix this?
In Module.php
'namespace' => arraymust benamespaces(in plural)Also you can compare your code with https://github.com/zendframework/zf2-tutorial