Skip to content

Instantly share code, notes, and snippets.

@cornernote
Created December 26, 2013 15:40
Show Gist options
  • Select an option

  • Save cornernote/8135158 to your computer and use it in GitHub Desktop.

Select an option

Save cornernote/8135158 to your computer and use it in GitHub Desktop.
yii bootstrap looking module without yiistrap or booster
.grid-view table.table th a:after {
display: inline-block;
float: right;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.grid-view table.table th a.asc:after,
.grid-view table.table th a:hover:after {
content: "\f062";
}
.grid-view table.table th a.desc:after,
.grid-view table.table th a.asc:hover:after {
content: "\f063";
}
/**
* Initializes the audit module.
*/
public function init()
{
parent::init();
// setup paths
Yii::setPathOfAlias('audit', dirname(__FILE__));
$this->setImport(array(
'audit.models.*',
'audit.components.*',
));
// map models
foreach ($this->getDefaultModelMap() as $method => $data)
foreach ($data as $name => $options)
if (empty($this->modelMap[$method][$name]))
$this->modelMap[$method][$name] = $options;
// setup components
Yii::app()->setComponents(array(
'widgetFactory' => array(
'class' => 'system.web.CWidgetFactory',
'widgets' => array(
'CListView' => array(
'pagerCssClass' => 'pagination-wrap',
),
'CGridView' => array(
'itemsCssClass' => 'table table-condensed table-striped',
'pagerCssClass' => 'pagination-wrap',
),
'CDetailView' => array(
'htmlOptions' => array(
'class' => 'table table-condensed table-striped',
),
),
'CLinkPager' => array(
'header' => false,
'hiddenPageCssClass' => 'disabled',
'firstPageLabel' => '<i class="fa fa-fast-backward"></i>',
'lastPageLabel' => '<i class="fa fa-fast-forward"></i>',
'nextPageLabel' => '<i class="fa fa-forward"></i>',
'prevPageLabel' => '<i class="fa fa-backward"></i>',
'htmlOptions' => array(
'class' => 'pagination',
),
),
),
),
), false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment