I would like to change the URL from http://localhost/domain/index/index/page/1 to http://localhost/domain/page/1.
I've already tried to change the routes, however, I've got some errors.
This is my controller part:
$page=$this->_getParam('page',1);
$paginator = Zend_Paginator::factory($images->fetchAll($images->select()->order('id ASC')));
$paginator->setItemCountPerPage(24);
$paginator->setCurrentPageNumber($page);
$this->view->paginator=$paginator;
View Part:
<?php
foreach($this->paginator as $record){
echo $record['name'];
}
?>
<?= $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
As you can see I'm using standard 'pagination.phtml' file. Thanks a lot for your help.
You can create routes as mentioned below:
This will work for below URL:
Default will be page 1 with below URL:
Edit:
Create
routes.iniinapplication/configs/directoryIn
Bootstrap.phpyou need to instantiate routes as follows: