0

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

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

哦,或者是为了让我可以做一个$this->getResource('something'). 如果我不退货,以后就无法获得资源?

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

当我这样做时,$x = $application->getOption('something');我从配置中获取了“某物”数组?我真的需要先做$application->getBootstrap()->bootstrap('something')吗?

4

1 回答 1

2

$x = $this->getResource('something'); its used to Initialize and retrieve a "something" resource so you can use that resource else where in the app

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

is used to to bootstrap the 'something' resource like DB , View ...etc in other words [to ensure that the something resource is initialized]

while

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

is used to read the config file of the 'something' resource it should be like

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

highly recommend you to check the quick start

于 2009-12-13T11:02:46.650 回答