2009-12-13 111 views
0

当我在引导程序中执行_init*()函数返回时,它实际上做了什么?这样我就可以不说:Zend Framework引导问题

$x = $this->bootstrap('something'); 

哦,或者是它让我可以做一个$this->getResource('something')。如果我不做回报,我以后得不到资源?

另外,当我做一个$x = $this->bootstrap('something');我想那会在bootstrap()之前自动运行?那是什么时候?

当我做$x = $application->getOption('something');我从配置中获取'something'数组?我需要先做一个$application->getBootstrap()->bootstrap('something')吗?

回答

2

$ x = $ this-> getResource('something'); 其用于初始化和检索“东西”的资源,所以你可以在这里应用

$x = $this->bootstrap('something'); 

其他使用该资源用于自举像数据库,视图...等 的“东西”在资源换句话说[以确保一些资源被初始化]

$x = $application->getOption('something'); 

被用来读取“东西”资源 的配置文件应该像

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" 

强烈建议你检查quick start