| new Pagination () | ใช้สร้าง Object ของ Library Pagination |
|---|---|
| initialize() | เป็นการกำหนด config ให้กับ Object Pagination |
| render() | ใช้คืนค่าการแสดงผลของ pagination |
method:new Pagination ( config );
return type:Object
content:ใช้สร้าง Object ของ Library Pagination
example:$config = array ( "uri_segment" => "page", "item_per_page" => "10", "total_items" => 186 ); $page = new Pagination ( $config ); echo $page->render ( "digg" );
comment:ตัวแปร config มี key ดังนี้ base_url คือ กำหนด url ก่อน segment uri_segment คือ ใส่ segment ต่อจาก base_url items_per_page คือ กำหนดจำนวนแถวต่อหน้า total_items คือ กำหนดจำนวนทั้งหมด style คือกำหนดรูปแบบของ pagination ได้แก่ classic, digg, extended, punbb
method:initialize ( config );
return type:void
content:เป็นการกำหนด config ให้กับ Object Pagination
example:$config = array ( "uri_segment" => "page", "item_per_page" => "10", "total_items" => 186 ); $page = new Pagination (); $page->initialize ( $config ); echo $page->render ( "digg" );
comment:ตัวแปร config มี key ดังนี้ base_url คือ กำหนด url ก่อน segment uri_segment คือ ใส่ segment ต่อจาก base_url items_per_page คือ กำหนดจำนวนแถวต่อหน้า total_items คือ กำหนดจำนวนทั้งหมด style คือกำหนดรูปแบบของ pagination ได้แก่ classic, digg, extended, punbb
method:render ( style );
return type:string
content:ใช้คืนค่าการแสดงผลของ pagination
example:$page = new Pagination (); $page->initialize ( $config ); echo $page->render ( "digg" );
comment:ตัวแปร style คือกำหนด style ให้กับ pagination โดยมีค่าที่เป็นไปได้ ได้แก่ classic, digg, extended, punbb