Welcome Guest, Not a member yet? Register   Sign In
Load CSS/JS dynamically in header.php depending on current view
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

Personally, I use a main template, and a library I call doc_head. If I need to add any CSS or script to the view, I simply add it through the library, and call $this->doc_head->output() from within my main template, and it appears. It's useful for dynamically inserting stylesheets, meta data and scripts.

Basically, all you need is a variable which you feed into the view, which your main template checks for, and echoes if it's set.


Messages In This Thread
Load CSS/JS dynamically in header.php depending on current view - by El Forum - 03-10-2013, 09:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB