Insert PHP into CSS in MVC structure

Asked

Viewed 81 times

-1

I’m trying to add CSS to a PHP file, so I can then change the properties of this CSS in an administrative panel, but I’m not finding the solution for that, does anyone have any idea how I can do it? In the image I am making the inline modifications , but want to do in a separate CSS file.

  • 2

    Celestino welcome. Guy avoid posting code image. Click ai on the edit link of your question is copy and paste the same code ok

1 answer

1

You can create a . php file that will process the css, just at the beginning of it put the following header

header("Content-type: text/css; charset: UTF-8");

And on the pages you will use, do the following:

<link rel="stylesheet" href="arquivo_do_css.php">

The browser will interpret the file as a stylesheet, regardless of the extension, due to the header and link tag.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.