Saturday, February 21, 2015

Re: Custom config file CakePHP 3.0 RC1

I'm using the CakePHP 3.0 RC2 not RC1

Le samedi 21 février 2015 20:09:21 UTC+1, Saif Turki a écrit :
Hi,
Sorry for my bad english :(
I tried to create a custom config file to read/update my application params like the sitename, phone, mail using a form ...
I add this lines on the bootsrap.php file:
// Custom config file
Configure::config('default', new PhpConfig('/config/'));
Configure::load('Company');

I create the Company.php file on the config folder(/config/Company.php) and add this line:
<?php

use Cake\Core\Configure;
use Cake\Core\Configure\Engine\PhpConfig;

Configure::write('Company.sitename', "My Company");

but when i want to debug the config vars using 
debug(Configure::read());
i have this error:

Could not load configuration file: /config/Company.php

Cake\Core\Exception\Exception

If you want to customize this error message, create src/Template/Error/error500.ctp

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: