- Seme Framework
- version 4.0.3
- Requirements
- Download & Install
- Configuration
- Tutorials
- URI Routing
- Constants
- Global Variables
- Model
- View
- Controller
- cdn_url
- config
- constructor
- getAdditional
- getAdditionalBefore
- getAdditionalAfter
- getAuthor
- getCanonical
- getContentLanguage
- getDescription
- getIcon
- getJsContent
- getJsFooter
- getJsReady
- getKey
- getKeyword
- getLang
- getRobots
- getShortcutIcon
- getThemeElement
- getTitle
- input
- lib
- load
- loadCss
- loadLayout
- putThemeContent
- putJsContent
- putJsFooter
- putJsReady
- render
- resetThemeContent
- session
- setAuthor
- setCanonical
- setContentLanguage
- setDescription
- setIcon
- setKey
- setKeyword
- setLang
- setShortcutIcon
- setTheme
- setTitle
- Library
- CLI (command line interface)
- Core
- Issue
- Deployment
Page Method
The page
method is part of database class builder for limiting query result.
Basic Usage
Here is the basic usage page
method from $db
property on SENE_Model class.
$this->db->page(int $page, int $pagesize): $this->db
Parameters
This method has 2 required parameters.
$page
The $page
value is for determine the current page of specified pagesize.
$pagesize
The $pagesize
the maximum result row count per page.
Example
On this example will show limiting the result query by using page
method in model class.
<?php
class Blog_Model extends SENE_Model{
var $tbl = 'blog';
var $tbl_as = 'b';
public function __construct(){
parent::__construct();
}
public function showFirstPagePer5Rows(){
$this->db->select("*");
$this->db->from($this->tbl,$this->tbl_as);
$this->db->order_by("date_create","desc");
$this->db->page(1,5);
return $this->db->get();
}
}