You are here

public function Pagination::paginate in Pagination (Node) 7

Same name and namespace in other branches
  1. 6 pagination.module \Pagination::paginate()

Paginate text by character count.

Parameters

$text: The text to paginate.

$cutoff: The length of characters to cut text into.

File

includes/Pagination.inc, line 53

Class

Pagination
Handles all the pagination logic

Code

public function paginate($text, $cutoff) {
  $textsize = strlen($text);
  do {
    $section = $this
      ->parseText($text, $cutoff);
    $this->page[] = $section;
    $textsize = strlen($text);
  } while ($textsize > 0);
}