yii-body-classes This behavior makes adding CSS body classes to your layouts quite simple

  1. Requirements
  2. Usage
  3. Resources

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!

Resources

1 0
2 followers
67 300 downloads
Yii Version: 1.1
License: GPL-3.0
Category: Others
Developed by: KingYes
Created on: Jun 4, 2014
Last updated: 4 years ago

Downloads

show all

Related Extensions