This behavior makes adding CSS body classes to your layouts quite simple
Requirements ¶
Yii 1.1 or above.
Usage ¶
Unpack release in the protected/extensions/yii-body-classes
folder.
Then add the behavior to a controller (or even better to your components/Controller.php
):
public function behaviors() {
return array(
'BodyClassesBehavior' => array(
'class' => 'ext.yii-body-classes.BodyClassesBehavior'
),
...
);
}
In your layouts/main.php
view, add to your body tag:
</head>
...
<body class="<?php echo $this->getBodyClasses(); ?>">
And you're done!
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.