Yii 1.1: cssattacher

Attach CSS anywhere in your application. Render only used styles in convenient way.
4 followers

This extension allows you to attach CSS styles anywhere you like. Just cast method to append styles global. Then script join it and register CSS file on page.

Requirements

Yii 1.1 or above

Usage

Include cssAttacher.php in your library.

$styles = array('#one'=>array('color'=>'#c00'));
cssAttacher::attach($styles);
 
... some code ... 
return "<div id='one'>Hello</div>";

Cast method at bottom in your layout

</html>
<?php cssAttacher::renderStyles(); ?>

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension