2011年3月5日星期六

[fw-mvc] Re: troubles with custom view-scripts location and noViewRender=true by default

Thanks Hector. Couple of further questions..


Hector Virgen wrote:
>
> resources.view.basePath = APPLICATION_PATH "/custom/path/to/views/"
>

Is there another way to state this setting globally without using an INI
file? The problem is that I need to generate this path *dynamically*, as the
ZF entry-point is within a shared codebase.


Hector Virgen wrote:
>
> $viewRenderer =
> Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
> $viewRenderer->setNoRender(true); // disable view rendering
>

Questions on this would be:

- Would this work at the Zend_Controller_Action::preDispatch() level, or is
that too late? (assuming the above would normally be in the front controller
plugin routeShutdown() method). My thinking would be to create a base action
controller with this in preDispatch() which I can subclass for whatever
action controllers need this logic.

- Will this work just as well with inverted logic/booleans, i.e.
Zend_Controller_Front->setParam('noViewRenderer')=true; and then
$viewRenderer->setNoRender(false); in the routeShutdown() or action
controller preDispatch() ??

Jonny

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/troubles-with-custom-view-scripts-location-and-noViewRender-true-by-default-tp3335661p3336467.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: