2011年1月28日星期五

Re: [fw-mvc] Re: How to extend Zend_View?

> I don't think that's what i'm looking for. I dont want to create a
differnt
> layout, i just want everything to work as normal (which it does if i dont
> use my own view), with only one exception - when it cant find a
> view-template. see class below.
>
Maybe it's an obvious question, but does it work when you replace your
own view by $view = new Zend_View();?

How do you set up your layout? What's weird is that your layout is not
found in your views/scripts path which is not the defaut path for layouts.

By the way, do you use your application.ini to configure your layout?
If you do, it is overriden by the Bootstrap::_initView() method, try
changing the name with _initMyView() and do:

Bootstrap.php
<?php
protected function _initMyView()
{
$this->bootstrap('view'); // be sure you bootstrap default views
paramters before to set your own
// Excudo_View extends Zend_View
$view = new Excudo_View();

// Add it to the ViewRenderer
$viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper( 'ViewRenderer' );
$viewRenderer->setView($view);

return $view;
}

Hope that helps

没有评论: