Download the PHP package white-october/pagerfanta-bundle without Composer

On this page you can find all versions of the php package white-october/pagerfanta-bundle. 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 pagerfanta-bundle

This project is no longer maintained. If you are using it with Symfony 3.4, 4.4 or 5, you may want to use this fork instead.

WhiteOctoberPagerfantaBundle

Build Status Scrutinizer Quality Score SensioLabsInsight

Bundle to use Pagerfanta with Symfony.

Note: If you are using a 2.0.x release of Symfony2, please use the symfony2.0 branch of this bundle. The master branch of this bundle tracks the Symfony master branch.

The bundle includes:

Installation

1) Use Composer to download the library

2) Then add the WhiteOctoberPagerfantaBundle to your application:

In Symfony < 4:

In Symfony 4 with Symfony Flex this will be done automatically for you.

3) Configure and use things!

A) Creating a Pager is shown on the Pagerfanta documentation. If you're using the Doctrine ORM, you'll want to use the DoctrineORMAdapter

B) Rendering in Twig is shown below in the Rendering Pagerfantas section.

C) Configuration is shown through this document

Rendering Pagerfantas

First, you'll need to pass an instance of Pagerfanta as a parameter into your template. For example:

You then call the the Pagerfanta Twig extension, passing in the Pagerfanta instance. The routes are generated automatically for the current route using the variable "page" to propagate the page number. By default, the bundle uses the DefaultView with the default name. The default syntax is:

By default, the "page" variable is also added for the link to the first page. To disable the generation of ?page=1 in the url, simply set the omitFirstPage option to true when calling the pagerfanta twig function:

You can omit template parameter to make function call shorter, default template will be used:

If you have multiple pagers on one page, you'll need to change the name of the page parameter. Here's an example:

Note the square brackets around page_other; this won't work without them.

Twitter Bootstrap

The bundle also has a Twitter Bootstrap view.

For Bootstrap 2:

For Bootstrap 3:

For Bootstrap 4:

Custom template

If you want to use a custom template, add another argument:

With options:

See the Pagerfanta documentation for the list of possible parameters.

Rendering the page of items itself

The items can be retrieved using currentPageResults. For example:

Translate in your language

The bundle also offers two views to translate the default and the twitter bootstrap views.

Adding Views

The views are added to the container with the pagerfanta.view tag:

XML

YAML

Reusing Options

Sometimes you want to reuse options of a view in your project, and you don't want to write them all the times you render a view, or you can have different configurations for a view and you want to save them in a place to be able to change them easily.

For this you have to define views with the special view OptionableView:

And using then:

The easiest way to render pagerfantas (or paginators!) ;)

Basic CSS for the default view

The bundles comes with basic CSS for the default view so you can get started with a good paginator faster. Of course you can change it, use another one or create your own view.

Configuration

It's possible to configure the default view for all rendering in your configuration file:

Making bad page numbers return a HTTP 500

Right now when the page is out of range or not a number, the server returns a 404 response by default. You can set the following parameters to different than default value to_http_not_found (ie. null) to show a 500 exception when the requested page is not valid instead.

More information

For more advanced documentation, check the Pagerfanta documentation.

Contributing

We welcome contributions to this project, including pull requests and issues (and discussions on existing issues).

If you'd like to contribute code but aren't sure what, the issues list is a good place to start. If you're a first-time code contributor, you may find Github's guide to forking projects helpful.

All contributors (whether contributing code, involved in issue discussions, or involved in any other way) must abide by our code of conduct.

Acknowledgements

Pablo Díez ([email protected]) for most of the work on the first versions of this bundle.

This project was originally located at https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.

License

Pagerfanta is licensed under the MIT License. See the LICENSE file for full details.


All versions of pagerfanta-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
pagerfanta/pagerfanta Version ^1.1.0|^2.0.0
symfony/framework-bundle Version ~2.3|~3.0|~4.0
symfony/property-access Version ~2.3|~3.0|~4.0
symfony/translation Version ~2.3|~3.0|~4.0
symfony/twig-bundle Version ~2.3|~3.0|~4.0
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 white-october/pagerfanta-bundle contains the following files

Loading the files please wait ....