Phpillip provides a default ContentController
that supports 3 actions:
To register a controller that displays a single achievement:
<?php
$this
->get('/achievements/{achievement}', 'content.controller:show')
->content('achievement');
The expected template achievement/show.html.twig
would receive the variable achievement
.
To register a controller that displays all achievements:
<?php
$this
->get('/achievements', 'content.controller:list')
->contents('achievement');
The expected template achievement/list.html.twig
would receive the variable achievements
.
To register a controller that paginates achievements:
<?php
$this
->get('/achievements', 'content.controller:page')
->paginate('achievement');
The expected template achievement/page.html.twig
would receive the following variables:
achievements
: Achievements for the current pagepage
: Index of the current pagepages
: Total number of pages