Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework: Application.ini what does resources.view[] = do?

i am wondering what does adding ...

resources.view[] = 

... init application.ini actually do?

i know it allows me to access the view from bootstrap by

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

but i wonder how does zf know resources.view = zend view? i guess doing that and accessing $view by getResource('view') will create a view initialized using the zend view plugin?

if i dont add the line resources.view[] = my app still has a zend view right? so why is that line required, just to get the view resource?

like image 653
Jiew Meng Avatar asked Sep 26 '26 10:09

Jiew Meng


1 Answers

That line triggers bootstrapping of the View resource, see:

http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.view

it allows you to set a load of options (doctype, encoding etc.) via. the application.ini.

Without that line you will still have a view yes, as the viewRenderer will create a View object on demand when it is first required.

like image 91
Tim Fountain Avatar answered Sep 28 '26 20:09

Tim Fountain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!