Download the PHP package franmomu/silex-pagerfanta-provider without Composer

On this page you can find all versions of the php package franmomu/silex-pagerfanta-provider. 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 silex-pagerfanta-provider

PagerfantaServiceProvider

Provider to use Pagerfanta with Silex

This Provider is based on WhiteOctoberPagerfantaBundle and includes:

Install

You have to add to your composer.json file:

or if you use Symfony2.2 components:

Registering

Parameters

This are the default parameters:

Rendering pagination

The Twig Extension provides this function:

{{ pagerfanta(my_pager, view_name, view_options) }}

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.

{{ pagerfanta(my_pager) }}

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

<div class="pagerfanta">
    {{ pagerfanta(my_pager, 'my_template') }}
</div>

With Options

{{ pagerfanta(my_pager, 'default', { 'proximity': 2}) }}

See the Pagerfanta documentation for the list of the parameters.

Adding a custom template

You can use the CSS classes provided with DefaultView, but if you want to create a Custom View, you have to implement , then add the View to the Factory:

$app['pagerfanta.view_factory'] = $app->share($app->extend('pagerfanta.view_factory', function($viewFactory, $app) {
    $customView = new \Foo\Bar\View\CustomView();
    $viewFactory->add(array(
        'my_view' => $customView
    ));

    return $viewFactory;
}));

And if you want set as default view:

$app['pagerfanta.view.options'] = array(
    'default_view'  => 'my_view'
);

Use in controllers

use Pagerfanta\Pagerfanta;
use Pagerfanta\Adapter\ArrayAdapter;

$app->get('/index', function (Request $request) use ($app) {

    $results = $app['some.service']->getResults();

    $adapter = new ArrayAdapter($results);
    $pagerfanta = new Pagerfanta($adapter);
    $pagerfanta->setMaxPerPage(10);
    $pagerfanta->setCurrentPage($request->query->get('page', 1));

    return $app['twig']->render('index.html', array(
        'my_pager' => $pagerfanta
    ));
})

All versions of silex-pagerfanta-provider with dependencies

PHP Build Version
Package Version
Requires silex/silex Version ~1.0
pagerfanta/pagerfanta Version ~1.0,>=1.0.3
symfony/property-access Version ~2.2
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 franmomu/silex-pagerfanta-provider contains the following files

Loading the files please wait ....