yii - how to serve the CSS as a result of a controller action in yii1 -
i want users have feature users can select color, font ,font size, font color etc. below theme.php file php file containing css.
<?php header('content-type:text/css'); ?> <style> .btn-default.btn-icon.btn-lg i{padding:10px 10px;font-size:<?php echo $size; ?>;line-height:1.33;border-radius:3px;color:<?php echo $color; ?>} </style>
how call this, values of $color, $size can taken database. have table called templates fields parameter name , parameter value. want use values table.
in controller or view file, can add:
$css = <<<eof .btn-default.btn-icon.btn-lg i{padding:10px 10px;font-size:{$size};line-height:1.33;border-radius:3px;color:{$color}} eof; yii::app()->getclientscript()->registercss('your-color', $css);
Comments
Post a Comment