|
PHP Enabled Stylesheets
Principles
The main principle of this solution is that all the involved components,
including the stylesheet, are PHP components that will be interpreted by the web
server before being offered to the user. All the involved components will
therefore be named with a
Illustrating this article requires the creation of three files:
.php file extension but the visual
configuration one that will use a .inc extension (include PHP
file).Illustrating this article requires the creation of three files:
- The CSS stylesheet
stylesheet.css.phpfile that is a normal CSS stylesheet but including some PHP code. For that reason, and although the.cssextension is kept, the file is named as a PHP file. For some reason that I don't know yet, this type of filename containing two dots can cause some problems on some operating systems. If so, simply change the filename fromstylesheet.css.phptostylesheetcss.php. - The visual configuration
visuals.incfile that will contain the visual configuration parameters as an array of key-value pairs (similar to the WINDOWS INI file way). This file is being included in the CSS stylesheet in order to make the visual configuration parameters available to the stylesheet. - The index
index.phpfile that is our test file and will mainly contain HTML code using the styles defined in the stylesheet.
To avoid any confusion, those three files are assumed to be stored in the
same directory. The location of this directory is not important as long as it is
located somewhere under the root of your web server. Let's move on to the
definition of the
[ Next Page ]visuals.inc file.
| Comments: | ||
| Broken links | Dave N. | 10/04/05 08:26 |
| RE: php interfaces & classes | Edson Luk | 04/22/05 14:30 |
| how to start creationg CSS in PHP | Pattan | 11/18/04 07:16 |
| RE: Caution! | Kaare | 05/22/04 15:19 |
| RE: How is this better than... | Jesus A. Domingo | 12/28/02 14:04 |
| RE: Template: Separate Design from Contents | Bertrand Potier | 12/28/02 09:57 |
| RE: Caution! | Jetboy | 12/21/02 14:18 |
| RE: Caution! | Jason | 12/19/02 09:42 |
| MIME Type | g_a_t_e | 12/18/02 07:18 |
| <STYLE> Tag | Brad | 12/17/02 23:12 |
| Template: Separate Design from Contents | Jean-Marc Molina [goa103] | 12/14/02 20:59 |
| Caution! | Jetboy | 12/14/02 16:49 |
| Very interesting | Tristan Crickett | 12/09/02 14:39 |
| RE: How is this better than... | Timothy Western | 12/04/02 08:44 |
| RE: How is this better than... | Bertrand Potier | 12/04/02 01:59 |
| RE: How is this better than... | CrazyToon | 12/03/02 19:15 |
| RE: How is this better than... | Eric | 12/02/02 21:09 |
| How is this better than... | Ross Bemrose | 11/28/02 07:48 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


