M
M
MaikMain2018-03-11 19:13:27
Yii
MaikMain, 2018-03-11 19:13:27

How to add rel="next" in Linkpager.Yii2?

Good day everyone)
I have a code:

<?php
                echo \yii\widgets\LinkPager::widget([
                    'pagination' => $pages,
                    'nextPageLabel' => "<i class='fa fa-angle-right' rel=\"next\"></i>",
                    'prevPageLabel' => "<i class='fa fa-angle-left'></i>",
                    'maxButtonCount' => 11,
                    'options' => ['class' => 'list-inline'],
                    'disabledPageCssClass' => false
                ]);
                ?>

And he renders it to:
<ul class="list-inline">
    <li class="prev"><a href="/author/index" data-page="0"><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"><i class="fa fa-angle-right" rel="next"></i></a></li>
</ul>

And the problem is this: how to add rel="next" and rel="prev" to this Yii2 Linkpager? How, where and what to ask?
Thank you very much in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-03-12
@webinar

www.yiiframework.com/doc-2.0/yii-widgets-linkpager...
'linkOptions' => ['rel'=>'next']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question