Question

When I do a return in an _init*() function in my bootstrap what does it actually do? so that I can do say a:

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

Oh or is it so that I can do a $this->getResource('something'). if I do not do a return I cannot get the resource later?

Also, when I do a $x = $this->bootstrap('something'); I guess that will be before bootstrap() automatically runs? When is that?

When I do a $x = $application->getOption('something'); I am getting the 'something' array from the config? Do I actually need to do a $application->getBootstrap()->bootstrap('something') first?

Was it helpful?

Solution

$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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top