Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put all css files in one file and all javascript files in one file [duplicate]

When I want to include any new CSS file or any new JS file, I put it in the header as this

css file

<link rel="stylesheet" href="<?php echo URL; ?>public/css/header.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/index.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/footer.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/signup.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/contactUs.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/option.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/question.css"  />
    <link rel="stylesheet" href="<?php echo URL; ?>public/css/profile.css"  />

js file

<script src=<?php echo URL . "public/Js/profile.js" ?>></script>
    <script src=<?php echo URL . "public/Js/cell.js" ?>></script>
    <script src=<?php echo URL . "public/Js/place.js" ?>></script>
    <script src=<?php echo URL . "public/Js/ontology.js" ?>></script>
    <script src=<?php echo URL . "public/Js/informativeObject.js" ?>></script>
    <script src=<?php echo URL . "public/Js/question.js" ?>></script>

I want something like

<header> 
include all css
include all js
</header>
like image 899
William Kinaan Avatar asked May 09 '12 16:05

William Kinaan


1 Answers

Minify is a PHP library that will combine all your CSS / JS files into one. Does that help at all?

like image 65
Wintermute Avatar answered Sep 24 '22 11:09

Wintermute