mam coś takiego na moim struktury katalogów wewnątrz modułu:W jaki sposób Zend Framework 2 renderuje cząstki wewnątrz modułu?
Api
├── Module.php
├── config
│ └── module.config.php
├── src
│ └── (..etc ..)
└── view
├── api
│ └── api
│ └── index.phtml
└── partial
└── test.phtml
Następnie robię tak:
<?= $this->partial('partial/test.pthml', array()); ?>
jednak uzyskać:
05-Jun-2012 14:56:58] PHP Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "partial/test.pthml"; resolver could not resolve to a file' in /Users/jeff/web/n/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:463
Gdzie powinien moje częściowe iść?
Twoja struktura katalogów jest poprawna a częściowy widok pomocnik jest ustawiony prawidłowo. Po prostu upewnij się, że masz '' template_path_stack '=> array (' user '=> __DIR__.' /../ view ') 'dodane do twojego pliku' module.config.php' i powinieneś być dobry. –