2008年9月18日星期四

[fw-mvc] Shared View Scripts

Hi List,

in my application a number of controllers have similar functionality and
thus identically named actions. There is, for example, a fulltext search
for module1 (ftsearchAction), a fulltext search for module2
(ftsearchAction) and so on. As a consequence, the view scripts for the
respective controller actions are identical. I would therefore like to
share these view scripts via a common folder. Unfortunately, when I try
to add such a script path - e.g. within the init() method of my
controllers -

$this->view->addScriptPath('../application/default/views/scripts/common');

the framework nevertheless expects the folder substructure I already
have within my views/scripts:

module1/ftsearch.phtml' not found in path
(../application/default/views/scripts/common/: ...)

module2/ftsearch.phtml' not found in path
(../application/default/views/scripts/common/: ...)

Is it possible to get rid of the moduleN "folder prefix" so that the
controller actions can actually share one view script?

Thanks a lot,

Stefan

--
Stefan Aumann Wiss. MA.@Hochschulrechenzentrum Philipps-Univ. Marburg
Hans Meerwein Str. 35032 Marburg | fon +49 (0)6421 28-23561 fax -26994

没有评论: