How to use a partial view from a different module in Zend?

levivanzele picture levivanzele · Apr 8, 2011 · Viewed 9.6k times · Source

I'm trying to access a partial view in foo from another module bar. Simplified file structure:

application/
    modules/
        foo/
            index.phtml
        bar/
            partial.phtml

And in index.html you would have the following code:

<?php echo $this->partialLoop('../bar/partial.phtml', $this->paginator);
echo $this->paginator; ?>

The problem is that you can't actually use parent traversal, as I get this error:

Requested scripts may not include parent directory traversal ("../", "..\" notation)

Is there any way to still include the partial view into my content page? (Or am I doing it wrong?) Thanks in advance.

Answer

prodigitalson picture prodigitalson · Apr 8, 2011

You need to pass the module argument:

<?php echo $this->partialLoop('partial.phtml', 'bar', $this->paginator); ?>