Render view in higher script path with Zend Framework
- by sander
Lets assume the following code within a controller:
$this->view->addScriptPath('dir1/views/scripts');
$this->view->addScriptPath('dir2/views/scripts');
$this->render('index.phtml');
Where dir1/views/scripts contains 2 files:
-index.phtml
-table.phtml
And dir2/views/scripts:
-table.phtml
Now, it will render the index.phtml in dir1 since dir 2 doesn't have an index.phtml.
Index.phtml looks something like:
<somehtml>
<?= $this->render('table.phtml') ?>
</somehtml>
This is where the confusion starts for me. I would expect it to render the table.phtml in the last directory added to the script path stack, but it doesn't.
Is there a simple solution/explanation to my problem?