-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set JS files to be display either header or footer #2
Comments
Hi. |
OKay simple echo js_files in when ever views right? supposed i had a 2 js files being declared in controller, i want the first js file to be header.php while the other one is place in the footer, placing simple echo js_files in the controller will result to duplicate js files both header and footer, how do we supposed to achieve this thanks |
Well what you can do is to echo
Then, in your master view file, echo it or check if it exists before, like so:
|
@Hirlysm831 please tell me if it worked for you so I can close this issue. |
Yes, it helps resolve the conflict somehow, thanks, by the way can you do something like this one? https://github.com/terrylinooo/Codeigniter-Simple-Template-Library setting the js/css to be on header and footer, check on the library it has switch case statement, if you dont mind doing it on your free time, im willing to wait XD |
I will see what I can do. Meanwhile, you can simply set a global variable (name it anything you want. i.e: js_in_header) and set it to false. Then in the main view file check if it's set to true or false to display JS tags in header or footer. |
Hello, good day i'm not used on posting issues in GitHub, bare me with this one thanks
is there a way we could set the .js files to be included on header and footer or its just me who don't know how to use properly the code thanks a lot.
The text was updated successfully, but these errors were encountered: