Fork me on GitHub

Pagination and databag


In this example the built-in pagination component in used with a databag.

The HTML code.

<div class="row">
    <!-- Custom attribute: Component for paginated content. -->
    <div class="col-md-12" <?= attr()->bind(rq(PageContentDb::class)) ?>>
    </div>
    <!-- Custom attribute: Component for pagination links. -->
    <div class="col-md-12" <?= attr()->pagination(rq(PageContentDb::class)) ?>>
    </div>
</div>

The exported class

The Jaxon library config

The Jaxon setup code.

<?php

jaxon()->app()->setup(configFile('pagination.php'));
The Javascript code is generated from this PHP template.

jaxon.dom.ready(() => {
    <?= rq(PageContentDb::class)->show() ?>;
});