I want to use a new file containing constants in Codeigniter so I created the file /config/labels.php
When I try to load it in my controller using $this->config->load('labels'); and it throws
application/config/labels.php file does not appear to contain a valid configuration array.
However when I put the code in the constants.php file everything works well.
labels.php
<?php
define('CLI_CIVILITE','Civilité');
define('CLI_NOM','Nom');
define('CLI_PRENOM','Prenom');
The config file should contain an array $config
Thats why it throws the error.
When the config class loads the config file, it checks if $config was set.
If not it will throw an error.
As far as I know there is no feature to load your own file with custom constants.
As of now you will have to add those constants to application/config/constants.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With