I create the controller and the view but I'm getting this error:
Zend\Mvc\Controller\ControllerManager::createFromInvokable: failed retrieving "newprojectcontrollernewproject(alias: Newproject\Controller\Newproject)" via invokable class "Newproject\Controller\new_controller"; class does not exist
Module.php
namespace Newproject;
class Module
{
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
}
module.config.php
return array(
'controllers' => array(
'invokables' => array('Newproject\Controller\Newproject' => 'Newproject\Controller\new_controller'),
),
'router' => array(
'routes' => array(
'newproject' => array(
'type' => 'segment',
'options' => array(
'route' => '/newproject[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+'),
'defaults' => array(
'controller' => 'Newproject\Controller\Newproject',
'action' => 'index'
),
)
)
)
),
'view_manager' => array('template_path_stack' => array('newproject' => __DIR__.'/../view'),
),
);
Controller class new_controller.php
namespace Newproject\Controller;
use Zend\Mvc\Controller\AbstractActionController;
class new_controller extends AbstractActionController
{
public function indexAction()
{
}
}