Oops, you need to call Zend_Layout::startMvc() first.

--
Hector


On Thu, Aug 13, 2009 at 4:45 PM, Steven Szymczak <[email protected]
> wrote:

> That results in a fatal error:
>
> Call to a member function setView() on a non-object in
> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php on line 63
>
> For some reason, Zend_Layout::getMvcInstance() isn't returning an object.
>
> Hector Virgen wrote:
>
>> You need to pass your custom view to the layout:
>>
>> protected function _initLayout()
>> {
>>    $view = $this->getResource('view');
>>    $layout = Zend_Layout::getMvcInstance();
>>    $layout->setView($view);
>> }
>>
>>
>> --
>> Hector
>>
>>
>> On Thu, Aug 13, 2009 at 3:35 PM, Steven Szymczak <
>> [email protected] <mailto:[email protected]>> wrote:
>>
>>    I'm now converting my site to use layouts, and I noticed (thanks to
>>    the error message) that Zend_Layout isn't using the suffix I set in
>>    the View Renderer when initializing the view ('html' instead of
>>    'phtml').
>>
>>    Within the application bootstrap, I initialize the view like so:
>>
>>           protected function _initView()
>>           {
>>                   $this->bootstrap('FrontController');
>>                   $front = $this->getResource('FrontController');
>>                                     $view = new Zend_View();
>>                   $view->addHelperPath('../library/Fs/View/Helper',
>>    'Fs_View_Helper');
>>                                     $viewRenderer = new
>>    Zend_Controller_Action_Helper_ViewRenderer($view);
>>                   $viewRenderer->setViewSuffix('html');
>>
>> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
>>                                     return $view;
>>           }
>>
>>    So how do I get Layout to use the same suffix?
>>
>>    --    スティーブン
>>
>>
>>
> --
> スティーブン
>
>

Reply via email to