acorncom/BodyClassBehavior
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This behavior makes adding CSS body classes to your layouts quite simple Unpack release in the protected/extensions folder. Then add the behavior to a controller (or even better to your components/Controller.php): public function behaviors() { return array( 'BodyClassBehavior' => array( 'class' => 'ext.BodyClassBehavior.BodyClassBehavior' ), ... ); } In your layouts/main.php view, add to your body tag: </head> ... <body class="<?php echo $this->getBodyClasses(); ?>"> And you're done! Code in this credit to Artifical and Nick Matthews (see http://www.yiiframework.com/forum/index.php/topic/28849-body-classes-based-on-url/)
About
A Yii behavior that makes adding CSS body classes to your layouts quite simple
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published