Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:45:18+00:00 2026-06-09T07:45:18+00:00

This is more a question of what browsers will do, rather than the back-end

  • 0

This is more a question of what browsers will do, rather than the back-end architecture.

I am using codeigniter and have a controller setup to handle assets (CSS, JS, and images), and at the moment I am simply processing the PHP out of CSS files and presenting them as CSS files to the browser, so www.mysite.com/asset/home.css will call the asset class and generate the CSS file for home from a single file.

I would like to make the request for the CSS files more dynamic, so that the request will determine multiple files that should be combined, and then passed to less.php for parsing and minimization.

Taking into account issues of caching, what would be the best method of passing variables to the CSS class? Flat Link URI variables? Traditional GET URI? I could use a database to reference a given name for its components, but isn’t that a lot of overhead?

Any thoughts or opinions are welcomed!

++ How would browsers handle something like standard.menu.comments.css?

+++ I ended up going with a URI string appended to the file. It’s not as clean I would want, but it appears to be working. I will likely move to a flat slash separated URI parser soon to clean up the request lines. Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:45:19+00:00Added an answer on June 9, 2026 at 7:45 am

    You can create a file style.php with the following header:

    <?php header("Content-type: text/css"); ?>
    

    And link this style in your template:

    <link rel="stylesheet" type="text/css" media="screen" href="style.php?color=red">
    

    Then you can import some stylesheets in your style.php:

    @import ("someStyle.css");
    

    Or you can pass some $_GET variables and create conditional styles:

    <?php 
        if ($_GET['color'] == 'red')
        {
            echo ".myBlock {background: #ff0000;}";
        } 
        else
        {
            echo ".myBlock {background: #00ff00;}";
        }
    ?>
    

    If you just don’t want your .css files to be cached, append random $_GET variable to your linked style:

    <link rel="stylesheet" type="text/css" media="screen" href="style.css?<?php echo time(); ?>">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ASP.Net MVC3 is cool and all but I have this question more out of
This is more of a design question. I have a template class, and I
I wish I could have a more helpful title for this question, but honestly
This is a high level/design type question rather than anything specific. In this game
This is more a question of pros/cons between PHP and JAVA. Iv been doing
This is more a question of practical database design. I've designed smaller databases before,
I'm not talking about making portable code. This is more a question of distribution.
This is more of a question about getting my head around the process I
This is more of a question of syntactic elegance, but I'm learning C++ and
This is more a general question but my particular case involves a ruby/rails app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.