Download the PHP package lampager/lampager-cakephp without Composer

On this page you can find all versions of the php package lampager/lampager-cakephp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lampager-cakephp

lampager-cakephp

CI Workflow Coverage Status Scrutinizer Code Quality

Lampager for CakePHP

Rapid pagination without using OFFSET

Requirements

Note

Installing

For SQLite users, see SQLite to configure.

Basic Usage

Simply install as a Composer package and use in one or more of the following methods:

Use in Controller

At first, configure $paginate to use \Lampager\Cake\Datasource\Paginator in your Controller class.

Use in a way described in the Cookbook: Pagination. Note the options that are specific to Lampager such as forward, seekable, or cursor.

Use in Table

Initialize LampagerBehavior in your Table class (AppTable is preferable) and simply use lampager() there.

The query builder (\Lampager\Cake\ORM\Query) extends the plain old \Cake\ORM\Query and is mixed in with \Lampager\Paginator. Note that some of the methods in \Lampager\Paginator, viz., orderBy(), orderByDesc(), and clearOrderBy() are not exposed because their method signatures are not compatible with the CakePHP query builder.

The methods from the CakePHP query builder, e.g., where(), are available. \Cake\Database\Expression\QueryExpression is accepted as well.

Classes

See also: lampager/lampager.

Name Type Parent Class
Implemented Interface
Description
Lampager\Cake\ORM\Query Class Cake\ORM\Query Fluent factory implementation for CakePHP
Lampager\Cake\Model\Behavior\LampagerBehavior Class Cake\ORM\Behavior CakePHP behavior which returns Lampager\Cake\ORM\Query
Lampager\Cake\Datasource\Paginator Class Cake\Datasource\Paginator CakePHP paginatior which delegates to Lampager\Cake\ORM\Query
Lampager\Cake\Paginator Class Lampager\Paginator Paginator implementation for CakePHP
Lampager\Cake\ArrayProcessor Class Lampager\ArrayProcessor Processor implementation for CakePHP
Lampager\Cake\PaginationResult Class Lampager\PaginationResult
Cake\Datasource\Paging\PaginatedInterface
PaginationResult implementation for CakePHP
Lampager\Cake\Database\SqliteCompiler Class Cake\Database\QueryCompiler Query compiler implementation for SQLite
Lampager\Cake\Database\Driver\Sqlite Class Cake\Database\Driver\Sqlite Driver implementation which delegates to Lampager\Cake\Database\SqliteCompiler

API

See also: lampager/lampager.

LampagerBehavior::lampager()

Build a Lampager query from Table in exactly the same way as CakePHP.

Paginator::__construct()
Paginator::create()

Create a new paginator instance. These methods are not intended to be directly used in your code.

Paginator::transform()

Transform a Lampager query into a CakePHP query.

Paginator::build()

Perform configure + transform.

Paginator::paginate()

Perform configure + transform + process.

Arguments

Return Value

e.g.,

(Default format when using \Cake\ORM\Query)

PaginationResult::__call()

\Lampager\Cake\PaginationResult implements \Cake\Datasource\Paging\PaginatedInterface.

Examples

This section describes the practical usage of lampager-cakephp.

Use in Controller

The example below shows how to accept a cursor parameter from a request and pass it through PaginatorComponent::paginate(). Be sure that your AppController has properly initialized Paginator as above.

And the pagination links can be output as follows:

Supported database engines

MySQL, MariaDB, and PostgreSQL

Supported!

Microsoft SQL Server

Not supported.

SQLite

Supported but requires an additional configuration.

In SQLite UNION ALL statements cannot combine SELECT statements that have ORDER BY clause. In order to get this to work, those SELECT statements have to be wrapped by a subquery like SELECT * FROM (...). CakePHP not natively handling this situation, Lampager for CakePHP introduces \Lampager\Cake\Database\Driver\Sqlite that needs to be installed on your application. Configure like the following in your config/app.php:


All versions of lampager-cakephp with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
cakephp/cakephp Version ^5.1
lampager/lampager Version ^0.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lampager/lampager-cakephp contains the following files

Loading the files please wait ....