When we do the pagination in Ravel 5.0, we try to link the page with the letters "Next" and "Prev" without displaying the page number.
Normally, you would use simplePaginate()
, but render()
displays only the string symbol (&lacquo;<raquo;
), and there are no characters.
Looking at the language file resources/lang/en/pagination.php
, there was a description like 'previous'=>'&lacquo;Previous'
, but there is no change in rewriting.
The getPreviousButton()
argument in the vendor
folder in SimpleBootstrapThreePresenter.php
seems to replace this character. Do I need to create a custom class to replace it myself?
You don't seem to have a mechanism in SimpleBootstrapThreePresenter that allows you to value the $this->getPreviousButton()
and $this->getNextButton()
, so you'll need to create a custom class to replace it yourself.
You can inherit SimpleBootstrapThreePresenter, override the render, and pass values to $this->getPreviousButton()
and $this->getNextButton()
.
public function render()
{
if($this->hasPages())
{
return sprintf(
'<ul class="pager">%s%s</ul>',
$this->getPreviousButton(trans('pagination.previous')),
$this->getNextButton(trans('pagination.next'))
);
}
return '';
}
'locale'=>'ja'
if you have set it to
Create a ja directory in resources/lang and include
pagination.php
<?php
return [
'previous' = > '«forward',
'next' = > 'Next & raquo;',
];
If you install it like that, it will work.
© 2024 OneMinuteCode. All rights reserved.