FuelPHP â ç¬èªã®è¨å®ãã¡ã¤ã«ãå©ç¨ãã
è¨å®ãã¡ã¤ã«ãä½æ
php oil g config sample test:test1
â/app/config/sample.php ã®è¨å®ãã¡ã¤ã«ãåºæ¥ãï¼ç´æ¥ãã¡ã¤ã«ãä½ã£ã¦ãããï¼
Â
è¨å®ãã¡ã¤ã«ãèªã¿è¾¼ã¿
常ã«èªã¿è¾¼ã
- é常
        ï¼ï¼ è¨å® â config.phpã®always_loadã®configãè¨å®
'config'Â => array('sample'),
         ï¼ï¼ä½¿ç¨ããç®æ
$val = Config::get('sample.test'); // test1ãåå¾ããã
- ã°ã«ã¼ãç¡ããè¨å®ã®å ´å
'config' => array('sample' => null), //config.phpã®è¨å®ã¨ãã¼ã¸ããã
$val = Config::get('test'); // test1ãåå¾ããã
- ã°ã«ã¼ãåãè¨å®ããå ´å
'config'Â => array('sample' => 'group1'),
$val = Config::get('group1.test'); // test1ãåå¾ããã
Â
使ç¨ããã¨ãã®ã¿èªã¿è¾¼ã
- é常
Config::load('sample', true); //config.phpã®è¨å®ã¨ãã¼ã¸ããã
$val = Config::get('sample.test'); // test1ãåå¾ããã
- ã°ã«ã¼ãç¡ããè¨å®ã®å ´å
Config::load('sample');
$val = Config::get('test'); // test1ãåå¾ããã
- ã°ã«ã¼ãåãè¨å®ããå ´å
Config::load('sample', 'group1');
$val = Config::get('group1.test'); // test1ãåå¾ããã