Hi I am creating a page pagination, how can I change to instead of
“http://localhost:8000/tags/page;2”
was
“http://localhost:8000/tags/strona;2”
By the way, if someone has time, they can check if the code below is correct
<?php
$filterBy = get('kategoria');
$unfiltered = $page->children()->listed();
$projects = $unfiltered
->when($filterBy, function($filterBy) {
return $this->filterBy('category', $filterBy);
})
->paginate(3);
$pagination = $projects->pagination();
$filters = $unfiltered->pluck('category', null, true);
?>
<main class="main">
<h1><?= $page->title() ?></h1>
<nav class="filter">
<a href="<?= $page->url() ?>">All</a>
<?php foreach ($filters as $filter): ?>
<a href="<?= $page->url() ?>?kategoria=<?= $filter ?>"><?= $filter ?></a>
<?php endforeach ?>
</nav>
<ul class="projects">
<?php foreach ($projects as $project): ?>
<li>
<a href="<?= $project->url() ?>">
<figure>
<?= $project->image()->crop(400, 500) ?>
<figcaption>
<?= $project->title() ?><br>
<small><?= $project->category() ?></small>
</figcaption>
</figure>
</a>
</li>
<?php endforeach ?>
</ul>
<?php if ($pagination->hasPages()): ?>
<nav class="pagination">
<?php if ($pagination->hasPrevPage()): ?>
<a href="<?= $pagination->prevPageUrl() ?>" aria-label="Go to previous page">←</a>
<?php else: ?>
<span>←</span>
<?php endif ?>
<span>Page <?= $pagination->page() ?> of <?= $pagination->pages() ?></span>
<?php if ($pagination->hasNextPage()): ?>
<a href="<?= $pagination->nextPageUrl() ?>" aria-label="Go to next page">→</a>
<?php else: ?>
<span>→</span>
<?php endif ?>
</nav>
<?php endif ?>
<?php foreach ($pagination->range(3) as $r): ?>
<li>
<a<?= $pagination->page() === $r ? ' aria-current="page"' : '' ?> href="<?= $pagination->pageURL($r) ?>">
<?= $r ?>
</a>
</li>
<?php endforeach ?>
</main>
Have a nice day!