Meet CodeIgniter MY_Model |
Added paginate() method. This one will allow you to paginate the results. You can do this by simply changing get_all() method with paginate() method. The paginate() method can receive up to three parameters:
- first paramater, which is optional (default is set to 10) is the number of rows per page; - second parameter, which is optional (default is set to NULL), is the total of rows; - the third parameter, which is also optional (default is set to 1) is the page you want to get. If you only passed the first parameter, the page number will be retrieved from the URL (the last segment of the page). If you didn't pass the second parameter you will only be able to output the previous and next page, without links to all the pages. Example: PHP Code: $total_posts = $this->post_model->count(); // retrieve the total number of posts Website: http://avenir.ro
|
Welcome Guest, Not a member yet? Register Sign In |