Starting a new project with the skeleton module and I'm running into some issues. I'm sure this is a basic config error on my part, but I can't figure it out.
Here is my module.config.php
return array(
'controllers' => array(
'invokables' => array(
'ZFTickets\Controller\Index' => 'ZFTickets\Controller\IndexController',
),
),
'router' => array(
'routes' => array(
'zftickets' => array(
'type' => 'Literal',
'options' => array(
// Change this to something specific to your module
//'route' => '/zftickets',
'route' => '/',
'defaults' => array(
// Change this value to reflect the namespace in which
// the controllers for your module are found
'__NAMESPACE__' => 'ZFTickets\Controller',
'controller' => 'Index',
//'controller' => 'ZFTickets\Controller\Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
// This route is a sane default when developing a module;
// as you solidify the routes for your module, however,
// you may want to remove it and replace it with more
// specific routes.
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'zftickets' => __DIR__ . '/../view',
),
),
and here is the directory structure:
The error I get is: Zend\View\Renderer\PhpRenderer::render: Unable to render template "zf-tickets/index/index"; resolver could not resolve to a file
The resolver is looking for zf-tickets/index/index
, but you're created the folders as zftickets/zftickets/index
. Change these and it should work fine.
You should also change the view manager part of your config to:
'view_manager' => array(
'template_path_stack' => array(
__DIR__ . '/../view',
),
),
The array key is irrelevant there, so what you currently have might appear confusing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With