Skip to content

Update PaginationController - #3480

Merged
adriendupuis merged 3 commits into
5.0from
Update-PaginationController
Nov 13, 2026
Merged

adriendupuis merged 3 commits into
5.0from
Update-PaginationController

Conversation

@adriendupuis

Copy link
Copy Markdown
Contributor
Question Answer
JIRA Ticket
Versions
Edition

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Request::get() is deprecated in 7.4, then removed in 8.x
# Conflicts:
#	code_samples/api/public_php_api/src/Controller/PaginationController.php
@github-actions

Copy link
Copy Markdown

Preview of modified files: no change to preview.

@github-actions

Copy link
Copy Markdown

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/api/public_php_api/src/Controller/PaginationController.php

docs/search/search_api.md@250:``` php
docs/search/search_api.md@251:// ...
docs/search/search_api.md@252:[[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 9, 15) =]]
docs/search/search_api.md@253: // ...
docs/search/search_api.md@254:[[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 20, 39) =]]
docs/search/search_api.md@255:```

001⫶// ...
002⫶use Ibexa\Core\Pagination\Pagerfanta\ContentSearchAdapter;
003⫶use Pagerfanta\Pagerfanta;
004⫶use Symfony\Component\HttpFoundation\Request;
005⫶use Symfony\Component\HttpFoundation\Response;
006⫶
007⫶class PaginationController extends Controller
008⫶{
009⫶ // ...
010⫶ public function showContentAction(Request $request, int $locationId): Response
011⫶ {
012⫶ $query = new LocationQuery();
013⫶ $query->filter = new Criterion\ParentLocationId($locationId);
014⫶
015⫶ $pager = new Pagerfanta(
016⫶ new ContentSearchAdapter($query, $this->searchService)
017⫶ );
018⫶ $pager->setMaxPerPage(3);

code_samples/api/public_php_api/src/Controller/PaginationController.php

docs/search/search_api.md@250:``` php
docs/search/search_api.md@251:// ...
docs/search/search_api.md@252:[[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 9, 15) =]]
docs/search/search_api.md@253: // ...
docs/search/search_api.md@254:[[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 20, 39) =]]
docs/search/search_api.md@255:```

001⫶// ...
002⫶use Ibexa\Core\Pagination\Pagerfanta\ContentSearchAdapter;
003⫶use Pagerfanta\Pagerfanta;
004⫶use Symfony\Component\HttpFoundation\Request;
005⫶use Symfony\Component\HttpFoundation\Response;
006⫶
007⫶class PaginationController extends Controller
008⫶{
009⫶ // ...
010⫶ public function showContentAction(Request $request, int $locationId): Response
011⫶ {
012⫶ $query = new LocationQuery();
013⫶ $query->filter = new Criterion\ParentLocationId($locationId);
014⫶
015⫶ $pager = new Pagerfanta(
016⫶ new ContentSearchAdapter($query, $this->searchService)
017⫶ );
018⫶ $pager->setMaxPerPage(3);
019⫶        $pager->setCurrentPage($request->query->get('page', 1));
019⫶        $pager->setCurrentPage((int) $request->query->get('page', 1));
020⫶
021⫶ return $this->render(
022⫶ '@ibexadesign/full/custom_pagination.html.twig',
023⫶ [
024⫶ 'totalItemCount' => $pager->getNbResults(),
025⫶ 'pagerItems' => $pager,
026⫶ ]
027⫶ );
028⫶ }
029⫶}

020⫶
021⫶ return $this->render(
022⫶ '@ibexadesign/full/custom_pagination.html.twig',
023⫶ [
024⫶ 'totalItemCount' => $pager->getNbResults(),
025⫶ 'pagerItems' => $pager,
026⫶ ]
027⫶ );
028⫶ }
029⫶}

Download colorized diff

@adriendupuis
adriendupuis marked this pull request as ready for review November 13, 2026 12:30
@adriendupuis
adriendupuis merged commit 7ff1ff7 into 5.0 Nov 13, 2026
8 of 10 checks passed
@adriendupuis
adriendupuis deleted the Update-PaginationController branch November 13, 2026 12:30
@github-actions

Copy link
Copy Markdown

Summary

Status Count
🔍 Total 754172
🔗 Unique 14977
✅ Successful 6421
⏳ Timeouts 0
🔀 Redirected 5
👻 Excluded 747746
❓ Unknown 0
🚫 Errors 5
⛔ Unsupported 0

Errors per input

Errors in site/getting_started/requirements/index.html

Errors in site/ibexa_products/ibexa_commerce/index.html

Errors in site/ibexa_products/ibexa_experience/index.html

Errors in site/ibexa_products/ibexa_headless/index.html

Errors in site/release_notes/ibexa_dxp_v4.4/index.html

Redirects per input

Redirects in site/getting_started/requirements/index.html

Redirects in site/ibexa_products/ibexa_commerce/index.html

Redirects in site/ibexa_products/ibexa_experience/index.html

Redirects in site/ibexa_products/ibexa_headless/index.html

Redirects in site/release_notes/ibexa_dxp_v4.4/index.html

Full Github Actions output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant