array in .env file |
In App.php there is an array variable:
public $toolbarCollectors = [ 'CodeIgniter\Debug\Toolbar\Collectors\Timers', 'CodeIgniter\Debug\Toolbar\Collectors\Database', 'CodeIgniter\Debug\Toolbar\Collectors\Logs', 'CodeIgniter\Debug\Toolbar\Collectors\Views', // 'CodeIgniter\Debug\Toolbar\Collectors\Cache', 'CodeIgniter\Debug\Toolbar\Collectors\Files', 'CodeIgniter\Debug\Toolbar\Collectors\Routes', 'CodeIgniter\Debug\Toolbar\Collectors\Events', ]; Is it possible to define an array variable in .env file? For example: app.css_files = [ 'bootstrap.css', 'fontawesome.css', 'stylesheet.css' ] or app.css_files = ['bootstrap.css', 'fontawesome.css', 'stylesheet.css']
This array doesn't sounds as environment thing, probably it's place is not in the .env
.env should be used to put only specific configuration settings which are critical for running the environment not everything.. In some cases you can even not use the .env and to set such settings directly at config files if it is will be same for all env's. How ever at the moment I see maybe only option to set json array string as setting (in single line) at .env and to parse it where you use it. app.css_files = '["bootstrap.css","fontawesome.css","stylesheet.css"]' Best VPS Hosting : Digital Ocean
app.css_files = '["bootstrap.css","fontawesome.css","stylesheet.css"]' is returning a string. In .env file there is an example but I think it doesn't work either. If so, CodeIgniter4 .env file style may be changed from apache to json or something else.
# app.CSRFExcludeURIs = []
Er, don't we already have what you are asking for?
https://bcit-ci.github.io/CodeIgniter4/g...-as-arrays (10-14-2018, 09:14 PM)obozdag Wrote: app.css_files = '["bootstrap.css","fontawesome.css","stylesheet.css"]' is returning a string. In .env file there is an example but I think it doesn't work either. If so, CodeIgniter4 .env file style may be changed from apache to json or something else. Yes, you need just to json_decode($IT, true) to get normal array. I think this is more then enough for such type of LIST. (10-14-2018, 10:39 PM)ciadmin Wrote: Er, don't we already have what you are asking for? Yes but those are assoc arrays. He is asking for just a list of entries without keys.. Code: SimpleConfig.address.city = "Berlin" Code: SimpleConfig.address.0 = "Berlin" Best VPS Hosting : Digital Ocean
|
Welcome Guest, Not a member yet? Register Sign In |