Welcome Guest, Not a member yet? Register   Sign In
On page CSS or JavaScript inclusion
#1

Does CI4 support on-page CSS or JavaScript inclusion like in Laravel allow?
Reply
#2

What do you mean by that? You can put whatever you want in your view. CSS and JavaScript can be added inline or loaded from external files.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#3

(09-29-2019, 06:43 AM)includebeer Wrote: What do you mean by that? You can put whatever you want in your view. CSS and JavaScript can be added inline or loaded from external files.

I know that we can insert js and css on view, but like in Laravel it add css and javascript to header or footer. is that kind of option available in CI4?
Reply
#4

There's nothing like that in the framework - though do check out the HTML helper as it can handle tags for you:
https://codeigniter4.github.io/CodeIgnit...elper.html

You might also be interested in this module which assists with CSS & JavaScript tags in header & footer:
https://forum.codeigniter.com/thread-73060.html
Reply
#5

When the AmpProject.org was introduced I created an online utility to create an Amp template by sending the required JavaScript components by get numeric parameters. This was necessary because Amp does not validate pages if there are unused JavaScripts included in the page.

The controller checked the URL parameters and only selected the required JavaScript files then concatenated the relevant files which was inserted into the web page.


https://amphtmldemo.tk/create-template
Reply




Theme © iAndrew 2016 - Forum software by © MyBB