コード例 #1
0
 /**
  * Provides css class by given attribute name and value.
  *
  * @param $name  string         attribute name
  * @param $value boolean|string attribute value
  *
  * @return string css class
  */
 public static function cssClassProvider($name, $value)
 {
     switch ($name) {
         case 'table_condensed':
             return $value ? 'table-condensed' : '';
             break;
         case 'collapsed_sidebar':
             return $value ? 'sidebar-collapse' : '';
             break;
         default:
             return parent::cssClassProvider($name, $value);
     }
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function bootstrap($app)
 {
     if ($this->_isBootstrapped) {
         return;
     }
     $this->_isBootstrapped = true;
     Yii::trace('Bootstrap themes', get_called_class() . '::bootstrap');
     $data = $this->getSettingsStorage()->get();
     $model = new Settings();
     $model->load($data);
     $theme = $this->hasItem($model->theme) ? $model->theme : null;
     $theme = $theme ?: $this->getDefaultTheme();
     $this->setTheme($theme);
     $this->getTheme();
 }