I'm really lost on how pagination works in kohana 3. Is there a good example of pagination in Kohana 3 anywhere?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You can find some decent docs in the unofficial Kohana wiki.
and then in the View, you just do
What happens here is Pagination class using it's View's __toString() magic method to render html needed to display pagination. All pagination params can be modified when creating the object (passing appropriate keys to the array passed to factory() method in our case).
Default key for pagination is "page" (query string), while you can modify that as well. Pagination also has a default config, which you can override by copying it to application/config folder.
Enjoy using it :)
In Kohana 3.1 pagination is not included. Download the module and put it in the modules folder. Enable the module in your application/bootstrap.php .This is my controller page. For further configuration copy the provided config file from modules/pagination/config/pagination.php to application/config/pagination.php
You may get error ErrorException [ Notice ]: Undefined property:
Request::$uri
. in the pagination class (module). In order to fix fix itUse
Request::current()->uri()
instead ofRequest::current()->uri