CSS thru PHP Parser vs. PHP as CSS source -



CSS thru PHP Parser vs. PHP as CSS source -

to have project respond contexts of content, want css files respond respectively instead of setting additional css files (adds http requests) or parsing css right within respective php script (imho: quite messy).

css thru php parser

now tell php parser via .htaccess treat css files too. disadvantages be: overhead of processing several css files in current project-structure or breaking construction activate parsing of css files in 1 subdirectory. either way so:

addtype application/x-httpd-php php php4 php3 css ... vs. php scripts css ressource

or link php source in page metadata css source. possible disadvantages: may browsers won't take files different extensions css ressource...? anyways...:

<link rel="stylesheet" type="text/css" href="/style/preprocessed.css.php" media="all">

what suggest?

<link rel="stylesheet" href="style.php"> should work fine in browsers, create sure set right header in php file:

header('content-type: text/css');

i wouldn't go parsing css files php, otherwise unsafe stuff:

/* bad.css */ <?php unlink('index.php'); ?>

...or whatever. shouldn't able happen (and other people working on project may not expect it).

ideally, process css beforehand , link minimized, regular css file.

php css .htaccess php-parser

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -