<?php
echo \yii\widgets\LinkPager::widget([
'pagination' => $pages,
'nextPageLabel' => "<i class='fa fa-angle-right'></i>",
'prevPageLabel' => "<i class='fa fa-angle-left'></i>",
'maxButtonCount' => 11,
'options' => ['class' => 'list-inline'],
'disabledPageCssClass' => false,
'linkOptions' => ['rel' => 'next']
]);
?>
<ul class="list-inline"><li class="prev "><span><i class="fa fa-angle-left"></i></span></li>
<li class="active"><a href="/rubric/html-and-css" rel="next" data-page="0">1</a></li>
<li><a href="/rubric/html-and-css/2" rel="next" data-page="1">2</a></li>
<li><a href="/rubric/html-and-css/3" rel="next" data-page="2">3</a></li>
<li class="next"><a href="/rubric/html-and-css/2" rel="next" data-page="1"><i class="fa fa-angle-right"></i></a></li>
</ul>
<ul class="list-inline">
<li class="prev"><a href="/author/index" data-page="0" rel="prev"><i class="fa fa-angle-left"></i></a></li>
<li><a href="/author/index" data-page="0">1</a></li>
<li class="active"><a href="/author/2" data-page="1">2</a></li>
<li><a href="/author/3" data-page="2">3</a></li>
<li class="next"><a href="/author/3" data-page="2" rel="next"><i class="fa fa-angle-right" rel="next"></i></a></li>
</ul>
public function getCourse()
{
return $this->hasMany(Course::className(), ['author' => 'id']);
}
public function getAuthor()
{
return $this->hasOne(Author::className(), ['id' => 'author']);
}
[
'attribute' => 'author',
'value' => 'author.name',
'filter' => \common\models\Author::getList(),
'options' => ['width' => '200']
],
[
'attribute' => 'author',
'value' => 'author',
'filter' => \common\models\Author::getList(),
'options' => ['width' => '200']
],
[
'attribute' => 'author',
'value' => 'authorName',
'filter' => \common\models\Author::getList(),
'options' => ['width' => '200']
],
public static function getList()
{
return ArrayHelper::map(self::find()->all(), 'id', 'name');
}
public function getAuthor()
{
return $this->hasOne(Author::className(), ['id' => 'author']);
}
public function getAuthorName()
{
return (isset($this->author)) ? $this->author->name : 'не задано';
}