keith Pope wrote:
2009/5/20 Sudheer Satyanarayana <[email protected]>:
Hello all,

I am trying to reuse a partial in all my modules.

I have the partial placed at modules/default/views/scripts/search.phtml

In the view script modules/admin/views/scripts/branch/index.phtml I have the
following code:

<?php echo $this->paginationControl($this->paginator, 'Sliding',
'search.phtml', array('default')); ?>

As per the documentation at
http://framework.zend.com/manual/en/zend.paginator.usage.html#zend.paginator.rendering
I am passing the module name in the additional parameters in the fourth
argument. But the partial from the default module is not called at all. I
get an exception with the message - string 'script 'search.phtml' not found
in path (.../application/modules/admin/views/scripts/).

Where did I go wrong?

You need to add the script path to the view, what I usually do is have
/application/views/scripts and use this as the global directory for
shared view elements. You can add the path during bootstrap.

Thanks for the quick reply.

But, isn't it a performance overhead? Lazy loading the script would be great. I read, it is possible according to the documentation.

http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.partial - Example 60.6. Rendering Partials in Other Modules

Did I completely misunderstand the concept?
To debug the issue, I copied the search.phtml file to admin/view/scripts and
everything works properly. But having a copy of this script in every module
is unmaintainable.


--

With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, 
Personal: http://sudheer.net

Reply via email to