Answer the question
In order to leave comments, you need to log in
Why listview distorts links in the view?
there is such code in the view
<li><a href="site/change-sort/?sort=showAll">показать все</a></li>
echo ListView::widget([
'dataProvider' => $listDataProvider,
'itemView' => $elView,
'options' => [
'tag' => 'div',
'class' => 'postslist',
'id' => 'post-list',
],
'layout' => "{items}",
'itemOptions' => [
'tag' => 'div',
'class' => 'post',
],
'emptyText' => 'Ничего не найдено..',
'pager' => [
'firstPageLabel' => 'Первая',
'lastPageLabel' => 'Последняя',
'nextPageLabel' => 'Следующая',
'prevPageLabel' => 'Предыдущая',
'maxButtonCount' => 10,
],
]);
echo ListView::widget([
'dataProvider' => $listDataProvider,
'itemView' => $elView,
'options' => [
'tag' => 'div',
'class' => 'postsslist',
'id' => 'post-list',
],
'layout' => "{items}\n{pager}",
'itemOptions' => [
'tag' => 'div',
'class' => 'post',
],
'emptyText' => 'Ничего не найдено..',
'pager' => [
'firstPageLabel' => 'Первая',
'lastPageLabel' => 'Последняя',
'nextPageLabel' => 'Следующая',
'prevPageLabel' => 'Предыдущая',
'maxButtonCount' => 10,
],
]);
<li><a href="site/change-sort/?sort=showAll">показать все</a></li>
<li><a href="site/site/change-sort/?sort=showAll">показать все</a></li>
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Is that how you write the link in the view?
If so, then use the helpers that are in yii2, do not be lazy to write them. Avoid a lot of problems by using helpers.
Or so, and at the output you get what they showed?
And then you need to look at the settings of your urlManager ().
Also consider the slash in the address
and
they will behave differently.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question