2012-10-22 4 views
1

module.config에 'currency'라는 새 모듈을 만들고 경로를 구성했습니다. 잘 작동합니다. 그 후 환율, CrateController라는 새로운 컨트롤러를 추가했습니다. 또한 양식, 모델 및 뷰 파일을 만들었습니다. 그러나 올바르게 라우팅되지 않습니다.템플릿을 렌더링 할 수 없습니다.

오류 :

Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "currency/crate/index"; resolver could not resolve to a file....

도움이 될 것입니다이 체크 아웃하는 모든 단서.

내 module.config 파일은 다음과 같습니다. 두 가지에 대한

return array(
'controllers' => array(
    'invokables' => array(
     'Currency\Controller\Currency' => 'Currency\Controller\CurrencyController', 
     'Currency\Controller\Crate' => 'Currency\Controller\CrateController', 
    ), 
), 

// The following section is new and should be added to your file 
'router' => array(
    'routes' => array(
     'currency' => array(
      'type' => 'segment', 
      'options' => array(
       'route' => '/currency[/:action][/:currency_id]', 
       'constraints' => array(
        'action' => '[a-zA-Z][a-zA-Z0-9_-]*', 
        'currency_id'  => '[0-9]+', 
       ), 
       'defaults' => array(
        'controller' => 'Currency\Controller\Currency', 
        'action'  => 'index', 
       ), 
      ), 
     ), 
     'crate' => array(
      'type' => 'segment', 
      'options' => array(
       'route' => '/crate[/:action][/:c_rate_id]', 
       'constraints' => array(
        'action' => '[a-zA-Z][a-zA-Z0-9_-]*', 
        'c_rate_id' => '[0-9]+', 
       ), 
       'defaults' => array(
        'controller' => 'Currency\Controller\Crate', 
        'action'  => 'index', 
       ), 
      ), 
     ),   
    ), 
), 

답변

11

확인 :

먼저 : 템플릿 파일 존재인가? ./module/Currency/view/currency/crate/index.phtml

둘째 : Oops..First 것은 실패 ./Currency/config/module.config.php

'view_manager' => array(
    'template_path_stack' => array(
     'currency' => __DIR__ . '/../view', 
    ) 
), 
+0

내부에 다음 항목이 있는지 확인합니다. 보기 폴더 폴더 아래에 index.phtml 파일을 만들지 않았습니다. 두 번째 것은 괜찮습니다. 이제는 효과가 있습니다. 도움 샘 주셔서 감사합니다 .. – cha

관련 문제