Zend view: bootstrap (view) or bootstrap (layout)

These are two different implementations for the _init function in the bootstrap associated with loading the view.

Immediately obvious: bootstrap('view')then it gets it as a resource

$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');

Another uses a long route through the layout bootstrap('layout')

$this->bootstrap('layout');        
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->doctype('XHTML1_STRICT');

I don’t want to judge that a longer code is ineffective just because it is longer. Is there something he adds by going through layoutfirst and not immediately clicking view?

+5
source share
2 answers

The short answer is no, actually.

Zend $view, , . , .

, , .

+6

:

: "Zend_Application_Bootstrap_Exception" " " /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php 662 (!) Zend_Application_Bootstrap_Exception: , /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php 662

Time    Memory  Function    Location

1 0.0004 236920 {main}()../index.php: 0

2 0.0124 1018696 Zend_Application- > bootstrap()../index.php: 25

3 0.0124 1018864 Zend_Application_Bootstrap_BootstrapAbstract- > bootstrap()../Application.php: 355

4 0.0124 1018896 Zend_Application_Bootstrap_BootstrapAbstract → _ bootstrap()../BootstrapAbstract.php: 586

5 0.0125 1022112 Zend_Application_Bootstrap_BootstrapAbstract → _ executeResource()../BootstrapAbstract.php: 622

6 0.0126 1022848 Bootstrap → _ initView()../BootstrapAbstract.php: 669

7 0.0126 1023208 Zend_Application_Bootstrap_BootstrapAbstract- > bootstrap()../Bootstrap.php: 7

8 0.0126 1023208 Zend_Application_Bootstrap_BootstrapAbstract → _ bootstrap()../BootstrapAbstract.php: 586

9 0.0126 1023208 Zend_Application_Bootstrap_BootstrapAbstract → _ executeResource()../BootstrapAbstract.php: 629

, , .

0

All Articles