-- monk.e.boy <[EMAIL PROTECTED]> wrote
(on Wednesday, 03 September 2008, 07:59 AM -0700):
>   I have a project with many controllers.  I am confused as to where the
> partials for a controller go, one controller is called 'foo' and my views
> are:
> 
> views/scripts/foo/
> 
>   So do I put my partials used in 'foo' in:
> 
> views/scripts/foo/partials/
> 
>   and global partials in:
> 
> views/partials/
> 
>   How do I access these, at the moment I am doing:
> 
> ( page.phtml )
> 
> <?= $this->partial('foo/partials/gui-element.phtml') ?>
> 
>   This seems wrong, why do I need to put 'foo/partials' in the path? Could
> someone please help?

Partials are just view scripts -- the only difference between render()
and partial() is that partial provides a clean variable scope.

The convention used with partials by most ZF developers I've queried is
to place them either at the top-level of your views/scripts/ directory
and to simply prefix them with an underscore: _gui-element.phtml. This
visually sets them apart within your view script directories.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to