Closed taufik-nurrohman closed 2 years ago
Not possible to remove $pager
safely because the $page
variable likely will be overriden by the temporary variable of $pages
’s item after foreach
:
echo $page->next->link; // Referenced from the `$GLOBALS['page']` :)
foreach ($pages as $page) {
echo $page->title; // This `$page` variable is no longer referenced to the `$GLOBALS['page']`
}
echo $page->next->link; // Overriden :(
Use dynamic property feature to generate
$page->next
,$page->parent
and$page->prev
properties. These properties, if available, will contains aPage
instance:For “pages” mode, we will use
link
in place ofurl
because URL that ends with numbers usually isn’t a page file (or not related directly to a page file):To assign custom page property directly to the current page instance:
To assign custom page property globally to any page instance: