Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Teng::Plugin::Pager::MUserFContributed PTeng::Plugin::Pager::MySQLFoundRows(3)

NAME
       Teng::Plugin::Pager::MySQLFoundRows - Paginate with SQL_CALC_FOUND_ROWS

SYNOPSIS
	   package MyApp::DB;
	   use parent qw/Teng/;
	   __PACKAGE__->load_plugin('Pager::MySQLFoundRows');

	   package main;
	   my $db = MyApp::DB->new(dbh => $dbh);
	   my $page = $c->req->param('page') ||	1;
	   my ($rows, $pager) =	$db->search_with_pager('user' => {type => 3}, {page => $page, rows => 5});

DESCRIPTION
       This is a helper	class for pagination. This helper only supports	MySQL.
       Since this plugin uses SQL_CALC_FOUND_ROWS for calculate	total entries.

METHODS
       my (\@rows, $pager) = $db->search_with_pager($table, \%where, \%opts);
	   Select from database	with pagination.

	   The arguments are mostly same as "$db-"search()>. But two
	   additional options are available.

	   $opts->{page}
	       Current page number.

	   $opts->{rows}
	       The number of entries per page.

	   This	method returns ArrayRef[Teng::Row] and instance	of
	   Teng::Plugin::Pager::Page.

AUTHOR
       Tokuhiro	Matsuno

perl v5.32.1			  2021-0Teng::Plugin::Pager::MySQLFoundRows(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Teng::Plugin::Pager::MySQLFoundRows&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help