Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a php header with different css and js?

Tags:

html

php

Quick and should be simple question, but i cant find the answer!!! So im trying to make a universal header called header.php. Now the only problem is that some pages have 5 css style sheets while others have only 2. And some pages have 5 js links in the header while some only have 1. How do i account for this variability in css and js links in the header? Am i suppose to use if statments? Variables? Thanks!

like image 667
Ben Avatar asked Nov 25 '25 20:11

Ben


1 Answers

Consider combining resources to single ones. This will minimize HTTP requests which is a good practice.

like image 123
fabrik Avatar answered Nov 28 '25 09:11

fabrik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!