I'm new to this framework and having a trouble rendering the view. here are my codes. I'm following a tutorial from this site http://zf2.readthedocs.io/en/latest/in-depth-guide/first-module.html. I'm really stuck here all i get is the same error over and over. thanks
module.config.php
return array(
// This lines opens the configuration for the RouteManager
'view_manager' => array(
'template_path_stack' => array(
__DIR__ . '/../view',
),
),
'controllers' => array(
'invokables' => array(
'Blog\Controller\List' => 'Blog\Controller\ListController'
)
),
'router' => array(
// Open configuration for all possible routes
'routes' => array(
// Define a new route called "post"
'post' => array(
// Define the routes type to be "Zend\Mvc\Router\Http\Literal", which is basically just a string
'type' => 'literal',
// Configure the route itself
'options' => array(
// Listen to "/blog" as uri
'route' => '/blog',
// Define default controller and action to be called when this route is matched
'defaults' => array(
'controller' => 'Blog\Controller\List',
'action' => 'index',
)
)
)
)
),
);
Edit:
Additional Information: Zend\View\Exception\RuntimeException
Message: Zend\View\Renderer\PhpRenderer::render: Unable to render template "blog/list/index"; resolver could not resolve to a file
module
Blog
config
module.config.php
src
Blog
Controller
ListController.php
view
blog
list
index.phtml
Module.php
Regarding my controller, it only contains this
namespace Blog\Controller;
use Zend\Mvc\Controller\AbstractActionController;
Class ListController extends AbstractActionController
{
}
Mezzio
. In my case, it turned out that I forgot to add theConfigProvider
for that module inconfig.php
. – GoharSahi