I can't solve this problem... I'm new in zend and this is a modified example from zend
Zend\Mvc\Router\Exception\RuntimeException File: C:\wamp\www\test\vendor\zendframework\zendframework\library\Zend\Mvc\Router\Http\TreeRouteStack.php:317 Message: Route with name "course" not found
this is my module.config.php
<?php
return array(
'controllers' => array(
'invokables' => array(
'Course\Controller\Index' => 'Course\Controller\IndexController',
), ),
'router' => array(
'routes' => array(
'index' => array(
'type' => 'Literal',
'options' => array(
'route' => '/course',
'defaults' => array(
'controller' => 'Course\Controller\Index',
'action' => 'index'
),
),
),
)
),
'view_manager' => array(
'template_path_stack' => array(
'course' => __DIR__ . '/../view/'
),
)
);
and IndexController.php
<?php
namespace Course\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController{
protected $courseTable;
public function indexAction()
{
return new ViewModel(array(
'courses' => $this->getCourseTable()->fetchAll(),
));
}
public function getCourseTable()
{
if (!$this->courseTable) {
$sm = $this->getServiceLocator();
$this->courseTable = $sm->get('Course\Model\CourseTable');
}
return $this->courseTable;
}
}
guys please help me, because I don't have any idea of what's wrong with this.