Public variable |
Codeigniter 3 I had in /config/config.php:
$config['cdn_url'] = 'https://domain.com/'; But Codeigniter 4 it does not work this way: public $cdn_url = 'https://domain.com/';
You can still use configuration files very much the same way that CI3 used to do them... Check out the user guide if you haven't already: https://codeigniter4.github.io/CodeIgnit...ation.html
It probably mostly comes down to what you want to be doing with that variable.
Anyway, the goal is to do this below for Codeigniter 4. It's hard. Can anyone help?
https://www.keycdn.com/support/codeignit...ntegration
That's a whole lot of work for a relatively simple result. If you are using an application that already includes all its assets using `base_url()` then it might save a little time by extending the URL Helper to override `base_url()`... but if you are writing new, or don't have that many calls to `base_url()` I'd recommend just doing this yourself. You could make a simple keycdn helper:
PHP Code: if (! function_exists('keycdn')) Then in your view just call that instead of `base_url()` anytime you want to use a CDN asset: `<?= keycdn('styles.css') ?>` (03-22-2019, 12:01 PM)edica Wrote: Anyway, the goal is to do this below for Codeigniter 4. It's hard. Can anyone help?you can call your config: echo Config('ConfigName')->property for example echo Config('App')->cdn_url |
Welcome Guest, Not a member yet? Register Sign In |