Class Gadget_Pager

Description

Gadget_Pager

Provides paging routines.

Template Example:

  1. <p class="center">
  2. {if: $hasPrev}
  3. <a href="{$widget->href($prev)}">&laquo; forward</a>
  4. {else}
  5. &laquo; forward
  6. {end}
  7. <span>|</span>
  8. {foreach: $moveLinks as $l}
  9. {if: $l->active}
  10. {$l->num}
  11. {else}
  12. <a href="{$widget->href($l->offset)}">{$l->num}</a>
  13. {end}
  14. <span>|</span>
  15. {end}
  16. {if: $hasNext}
  17. <a href="{$widget->href($next)}">back &raquo;</a>
  18. {else}
  19. back &raquo;
  20. {end}
  21. </p>

  • since: 1.0

Located in /Gadget/Pager.php (line 58)

Gadget_Object
   |
   --Gadget_Widget
      |
      --Gadget_Pager
Variable Summary
bool $hasNext
bool $hasPrev
int $limit
array $moveLinks
int $next
int $offset
bool $page
int $prev
Method Summary
int getLimit ()
string href (int $offset, [bool $amp = true])
void makeMetaLinks (int $total)
void makeMoveLinks (int $total)
void makePrevNext (int $total)
void page (int $total)
Variables
bool $aggregateFormatter = true (line 121)

Load Gadget_Formatter by default


Redefinition of:
Gadget_Widget::$aggregateFormatter
Whether to call aggregateFormatter() at construction time
bool $hasNext = false (line 86)

Has next page

bool $hasPrev = false (line 79)

Has previous page

int $limit = 10 (line 100)

Limit

array $moveLinks = array() (line 107)

Move Links

int $next = 0 (line 72)

Offset of next page

int $offset = 0 (line 93)

Current Offset

bool $page = true (line 114)

Whether to do anything if page() is called

int $prev = 0 (line 65)

Offset of previous page

Inherited Variables

Inherited from Gadget_Widget

Gadget_Widget::$auth
Gadget_Widget::$elements
Gadget_Widget::$form
Gadget_Widget::$ID
Gadget_Widget::$location
Gadget_Widget::$main
Gadget_Widget::$qform
Gadget_Widget::$queryString
Gadget_Widget::$render
Gadget_Widget::$rights
Gadget_Widget::$show
Gadget_Widget::$template
Methods
getLimit (line 164)

Get Limit

Override this in your Widget to return a custom limit.

  • access: public
int getLimit ()
href (line 195)

Href

  • access: public
string href (int $offset, [bool $amp = true])
  • int $offset
  • bool $amp
makeMetaLinks (line 224)

Make Meta Links

  • access: protected
void makeMetaLinks (int $total)
  • int $total
makeMoveLinks (line 256)

Make Move Links

  • access: protected
void makeMoveLinks (int $total)
  • int $total
makePrevNext (line 208)

Make Prev and Next Calculations

  • access: protected
void makePrevNext (int $total)
  • int $total
onAfterConstruct (line 147)

On After Construct

  • access: protected
void onAfterConstruct ()

Redefinition of:
Gadget_Widget::onAfterConstruct()
On After Construct
onBeforeConstruct (line 129)

On Before Construct

  • access: protected
void onBeforeConstruct ()

Redefinition of:
Gadget_Widget::onBeforeConstruct()
On Before Construct
page (line 178)

Page

This method must be called with the total count of items.

  • access: public
void page (int $total)
  • int $total

Inherited Methods

Inherited From Gadget_Widget

Gadget_Widget::aggregateFormatter()
Gadget_Widget::create()
Gadget_Widget::form()
Gadget_Widget::load()
Gadget_Widget::main()
Gadget_Widget::oddEven()
Gadget_Widget::onAfterConstruct()
Gadget_Widget::onBeforeConstruct()
Gadget_Widget::queue()
Gadget_Widget::queueAfter()
Gadget_Widget::render()
Gadget_Widget::requeue()
Gadget_Widget::unqueue()
Gadget_Widget::unsufficientRights()

Inherited From Gadget_Object

Gadget_Object::Gadget_Object()
Gadget_Object::onAfterConstruct()
Gadget_Object::onBeforeConstruct()
Gadget_Object::setOptions()

Documentation generated on Sun, 03 Jul 2005 12:46:02 +0200 by phpDocumentor 1.3.0RC3