我的配置值是
'controllers' => array(
'invokables' => array(
'System\Controller\Index' => 'System\Controller\IndexController',
'System\Controller\Config' => 'System\Controller\ConfigController'
),
),
'view_manager' => array(
'template_path_stack' => array(
'system' => __DIR__ . '/../view',
)
),
'router' => array(
'routes' => array(
// using the path /application/:controller/:action
'system' => array(
'type' => 'segment',
'options' => array(
'route' => '/system/index[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'System\Controller\Index',
'action' => 'index',
),
),
),
),
),
和目录stutrue在图片中。
我还缺少其他的东西吗?因为我在zf2应用程序中收到错误消息。
错误消息:
Zend \ View \ Renderer \ PhpRenderer :: render:无法渲染模板" system / index / index&#34 ;;解析器无法解析为文件
答案 0 :(得分:0)
试试这个:
'view_manager' => array(
'template_path_stack' => array(
'system' => array(__DIR__ . '/../view'),
)
),