Zend 框架:Application.ini resources.view[] = 做什么? [英] Zend Framework: Application.ini what does resources.view[] = do?

查看:23
本文介绍了Zend 框架:Application.ini resources.view[] = 做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道添加...

resources.view[] = 

...init application.ini 究竟是做什么的?

... init application.ini actually do?

我知道它允许我从引导程序访问视图

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

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

但我想知道 zf 怎么知道 resources.view = zend 视图?我想这样做并通过 getResource('view') 访问 $view 将创建一个使用 zend 视图插件初始化的视图?

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?

如果我不添加行 resources.view[] = 我的应用程序仍然有一个 zend 视图,对吗?那么为什么需要该行,只是为了获取视图资源?

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?

推荐答案

该行触发了 View 资源的引导,参见:

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

它允许您通过设置大量选项(文档类型、编码等).应用程序.ini.

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

如果没有那条线,你仍然会有一个视图是的,因为 viewRenderer 会在第一次需要时按需创建一个 View 对象.

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.

这篇关于Zend 框架:Application.ini resources.view[] = 做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆