Simple functional library to read .ENV file and call its value using simple function env() everywhere in project.
- Download and merge
configdirectory to project's root directory. - Update
config-loader.phpfile with Path of ENV file. Default is set already. - Add following line in any of the header/main config file or
index.phpin case of frameworks like Codeigniter 3.x
require('config/config-loader.php');
- Add varable in .ENV file as set
- Use following format
KEY=VALUE
- Empty lines will be ignored
Make sure no further
=sign is there in key/value beside main saparator - Use the function simply as follow
env('BASE_URL');
That's it.
