php bootstrap

Hi

i’m trying to load bootstrap in a bootstrap file by selecting from db like this (this is a modular system)

public function bootstrap($app){

                $app->bootstrap[]= 'modules/test/bootstrap';





                var_dump($app->bootstrap);

}

when i set ‘modules/test/bootstrap’ in confing main.php it is work currectly

when i do it by top code ‘modules/test/bootstrap’ dos not execute, but var_dump show it in bootstrap array.

why it not work ??

Most probably you’re setting it too late. Bootstrap process kicks in early.

ok, where i can set bootstaps by selecting from db???

http://www.yiiframework.com/doc-2.0/guide-runtime-bootstrapping.html

Either index.php, one of config files or extended application class.

thank you.