Class PageLister

Description

Located in /PageLister.class.php (line 37)


	
			
Method Summary
string GetHTML ()
string GetQuery ()
boolean SetCountHandler (mixed $object, resource $resource)
boolean SetEntriesPerPage (int $entries)
boolean SetHtmlHandler (mixed $object, resource $resource)
boolean SetQuery (string $query)
boolean SetURL (string $url, [string $getName = 'pagenumber'])
Methods
GetHTML (line 245)

Returns the calculated HTML-Code.

Returns the calculated HTML-Code. After setting the query, you may want to get the HTML-Code. To do this, you have to define a HTML-handler with the method SetHtmlHandler(). You may change the HTML-handler after calling this and get different outputs for the pagelist.

  • access: public
string GetHTML ()
GetQuery (line 278)

Returns the modified query.

Returns the modified query. This method returns the modified query you may use to get the entries of the current page. If you selected MySQLi as handler, you may use this as following:

  1. $query = $PageLister->GetQuery();
  2. $result = $mysqli->query($query);

  • access: public
string GetQuery ()
GetTotalEntries (line 292)

Returns the total entries.

Returns the total entries.

  • access: public
int GetTotalEntries ()
SetCountHandler (line 126)

Sets the handler to count all entries.

Sets the handler to count all entries. The PageLister uses an external handler for counting all entries. This way don't have to define everytime a new handler, when you want to use more than one PageLister.

  • access: public
boolean SetCountHandler (mixed $object, resource $resource)
  • resource $resource
SetEntriesPerPage (line 202)

Sets entries per page.

Sets entries per page. If you want to display more or less entries than defaultvalue, you can change the amount with this method.

  • access: public
boolean SetEntriesPerPage (int $entries)
  • int $entries
SetHtmlHandler (line 152)

Sets the handler to output the html.

Sets the handler to output the html. The PageLister uses an external handler for outputting the HTML. This way don't have to define everytime a new handler, when you want to use more than one PageLister.

  • access: public
boolean SetHtmlHandler (mixed $object, resource $resource)
  • resource $resource
SetQuery (line 224)

Sets the Query to count.

Sets the Query to count. This method must be called before you call any of the Get-methods. Here you can set the query to count. Remember, to not add an LIMIT x,x to the query, this will be automaticaly done by the PageLister. The query will later be handled by PageLister_CountHandler.

  • access: public
boolean SetQuery (string $query)
  • string $query
SetURL (line 186)

Sets the URL, where the HTML-Code should link to.

Sets the URL, where the HTML-Code should link to. If you want to link to another URL than the current one, you can specify an URL with this function and change the name of the pagenumber in $_GET. If you only want to change the name of the pagenumber, you may pass `null` as URL. If you use searchengine-friendly URLS, you can pass an URL like: http://www.something.com/articles/page_%PN%/ The %PN% will be replaced by the pagenumber in the HTML-Code. If there is no placeholder for the pagenumber in the URL, PageLister will automaticaly add the pagenumber to the end of the GET-variables.

  • access: public
boolean SetURL (string $url, [string $getName = 'pagenumber'])
  • string $url
  • string $getName

Documentation generated on Thu, 12 Oct 2006 12:20:31 +0200 by phpDocumentor 1.3.0RC3