No base_url() in view parser |
Hi,
I read the site https://codeigniter4.github.io/CodeIgnit...arser.html , but it seems there is no non-php alternative for base_url(), which makes problems for loading css, pictures and other resources. Anyone knows how to use it?
Yeah, the parser class will not execute PHP.
Could you store the base_url as a variable so you do {base_url}{link} type thing? Hope that makes sense. Paul
You could store the base_url in a plugin there is a doc on it in the parser documentation.
All you would need to do is create a plugin for it. There is already a plugin for site_url so you could copy that one. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Here is my solution for this problem:
inside the controller: PHP Code: $this->data['bootstrap_css'] = base_url('assets/templates/kigh_bootstrap/css/bootstrap.min.css'); inside the view to parse: Code: <!-- Bootstrap core CSS --> Also I did it with JS ! Enjoy |
Welcome Guest, Not a member yet? Register Sign In |