Download the PHP package angelxmoreno/phalcon-collection-paginator without Composer
On this page you can find all versions of the php package angelxmoreno/phalcon-collection-paginator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download angelxmoreno/phalcon-collection-paginator
More information about angelxmoreno/phalcon-collection-paginator
Files in angelxmoreno/phalcon-collection-paginator
Package phalcon-collection-paginator
Short Description A Phalcon paginator adapter for Phalcon Collections
License MIT
Informations about the package phalcon-collection-paginator
Phalcon Collection Paginator
A Phalcon paginator adapter for Phalcon Collections
Why create this?
Being familiar with the various Pagination data adapters
available to the Phalcon\Mvc\Model
, I expected to see similar adapters for Phalcon\Mvc\Collection
. This project is to provide a pagination data adapter for ODM in Phalcon.
Installation
- Use composer
-
Run
- Make sure to include Composer's autoload.php file as part of your bootstrapping process
Configuration
Property | Description | Optional | Default |
---|---|---|---|
limit | The number of items to fetch at a time | yes | 30 |
page | The current page set to fetch | yes | 1 |
collection | The collection class' FQN to use for fetching | no | none |
find_query | An array to use when building the query for the page set. Must be a find() compatible array. |
yes | [] |
Example
CollectionPaginator->getPaginate()
returns an \stdClass.
Running tests
Contributing
- Fork the repo
- Branch from master
- Open a PR
License
(The MIT license)
Copyright (c) 2017 Angel S. Moreno
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.