Does anyone know where to store a ZF2 partial loop template file?
I have template stored in the relevant view folder under a standard Zend file structure. This worked under ZF1. But on trying to re-factor code to work with ZF2 I get this error?
Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message
'Zend\View\Renderer\PhpRenderer::render: Unable to render template
"listingsPartial.phtml"; resolver could not resolve to a file' in C:\zendProject\zf2\vendor\zendframework\zendframework\library\Zend\View\Renderer\PhpRenderer.php:454 Stack trace: #0 C:\zendProject\zf2\vendor\zendframework\zendframework\library\Zend\View\Helper\Partial.php(73):
Zend\View\Renderer\PhpRenderer->render('listingsPartial...') #1 C:\zendProject\zf2\vendor\zendframework\zendframework\library\Zend\View\Helper\PartialLoop.php(70): Zend\View\Helper\Partial->__invoke('listingsPartial...', Array) #2 [internal function]: Zend\View\Helper\PartialLoop->__invoke('listingsPartial...', Array) #3 C:\zendProject\zf2\vendor\zendframework\zendframework\library\Zend\View\Renderer\PhpRenderer.php(355):
call_user_func_array(Object(Zend\View\Helper\PartialLoop), Array) #4 C:\zendProject\zf2\module\Landlord\view\landlord\home\index.phtml(42):
Zend\View\Renderer\PhpRenderer->__call
('p in C:\zendProject\zf2\vendor\zendframework\zendframework\library\Zend\View\Renderer\PhpRenderer.php on line 454
My call to the partial loop looks like this:
echo $this->partialLoop('listingsPartial.phtml',$model);
The template and view page on which it is called are stored in the same file. I wondered if I need to list the listingsPartial template somewhere i.e. in the module or config files?
My directory structure looks like this:
> zf2
-module
-moduleName
-view
> -moduleName
> -controllerName
> - *the view file and partial template file are stored here-*
Any suggestions appreciated.