Is it a bad practice to make a header and footer file and call EVERY script and style sheet inside ?
scripts stylesheets
|
03-10-2019, 09:41 PM
@ChiKaLiO,
Its only bad practice if your not using EVERY script and style sheet for every page. You can create a standard header and footer and if necessary give them the capability to add additional script and style sheets.
03-10-2019, 10:07 PM
(03-10-2019, 09:41 PM)php_rocs Wrote: @ChiKaLiO, y thats exactly what made me think lol so for "special" scripts/stylesheets i just add them to the body or there is a better way to do it ?
03-11-2019, 12:06 AM
(This post was last modified: 03-11-2019, 12:55 AM by John_Betong.)
(03-10-2019, 06:51 PM)ChiKaLiO Wrote: Is it a bad practice to make a header and footer file and call EVERY script and style sheet inside ? For simple sites I have recently started to generate web-pages by using a common master View template which caters for the vast majority of cases: Parameters passed to the common template are all generated in Controllers and passed to the following View: PHP Code: <?php CI4-Strict version - Updated
download and make your system directory strict
03-11-2019, 07:02 AM
@ChiKaLiO,
Another approach is you could create a master header and footer view that has all styles and scripts which can be turned on or off by the value settings of an array. i.e. $data[viewheader] =[0,1,0,1] //[custom-scipt,jquery-js,custom-css,jquery-css] |