Render view in higher script path with Zend Framework

Posted by sander on Stack Overflow See other posts from Stack Overflow or by sander
Published on 2010-02-11T08:32:00Z Indexed on 2010/06/13 9:22 UTC
Read the original article Hit count: 233

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about zend-view