We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Router paginator

Hello!

         <p class="pagination">
            <a href="page/1">first</a>
            <a href="page/<?=$model_releases->before; ?>">prev</a>
            <?php echo "Page ", $model_releases->current, " from ", $model_releases->total_pages; ?>
            <a href="page/<?=$model_releases->next; ?>">next</a>
            <a href="page/<?=$model_releases->last; ?>">last</a>
        </p>

$router->add( "/page/{page:[0-9]+}", array( 'controller' => 'index', 'action' => 'index' ) ); when on main page i have addres on pagination with prefix "page", click to any page on pagin and have double "page" like this "/page/page/3. Why wrong and how this fix?



11.2k

imo you need to change

href="page

to

href="/page


1.9k

No, need add "page" to adress because used on defferent page but identical construct. One view for three adress.