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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

python - How to remove the Xframe Options header in django? -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -