2017 © Pedro Peláez
 

symfony-bundle pager-bundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

image

gloomy/pager-bundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  • Tuesday, April 8, 2014
  • by iamluc
  • Repository
  • 3 Watchers
  • 10 Stars
  • 526 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

GloomyPagerBundle

ABOUT

Note:, (*1)

This bundle has been replaced by the DatathekePagerBundle, (*2)

You should use it instead, (*3)

The GloomyPagerBundle allows you to display data with pagination, and to easily order and filter them., (*4)

4 services are available : - Pager lets you manipulate resources like an Array or an Entity, but you keep total control of your template. - DataGrid allows you to render a default template. But you can of course customize each part of it. It's built on top of the Pager. - Crud adds create/edit/delete views in addition of the DataGrid view. It's built on top of the DataGrid. - REST Connectors let you connect to a JavaScript grid or autocompleter easily (like jqGrid, DataTables, Autocomplete, Typeahead etc...), (*5)

Features are : - Many wrappers, (*6)

    Array
    Entity / ORM QueryBuilder
    DBAL QueryBuilder
    MongoDB
    Datatheke.com
    Null
  • Advanced filtering (AND/OR); ``` php <?php //... $filters = array( 'operator' => 'and', 'criteria' => array( array( 'field' => 'job', 'operator' => 'contains', 'value' => 'Director' ), array( 'operator' => 'or', 'criteria' => array( array( 'field' => 'firstname', 'operator' => 'contains', 'value' => 'y' ), array( 'field' => 'moviesNb', 'operator' => 'less', 'value' => 30 ),, (*7)

                                                    )
                                                )
                                            )
                    );

- Multiple ordering (order by lastname asc, firstname asc) - Ajax compatible - Many pagers on the same page LICENSE ------- MIT EXEMPLES -------- More exemples in the [documentation](https://github.com/iamluc/GloomyPagerBundle/tree/master/Resources/doc) ##Crud PHP ``` php <?php //... /** * @Template() */ public function crudAction() { return $this->get('gloomy.crud')->factory('MyBundle:MyEntity')->handle(); }

TWIG, (*8)

``` html+django {{ crud(crud) }}, (*9)


##Datagrid PHP ``` php <?php //... /** * @Template() */ public function dataGridAction() { return array('datagrid' => $this->get('gloomy.datagrid')->factory('MyBundle:MyEntity')); }

TWIG, (*10)

``` html+django {{ datagrid(datagrid) }}, (*11)


##Pager PHP ``` php <?php //... /** * @Template() */ public function pagerAction() { return array('pager' => $this->get('gloomy.pager')->factory('MyBundle:MyEntity')); }

TWIG, (*12)

``` html+django {% extends "::base.html.twig" %}, (*13)

{% import 'GloomyPagerBundle:Pager:macros.html.twig' as helper %}

{% block stylesheets %}
    {{ parent() }}
    {{ helper.stylesheets() }}
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    {{ helper.javascripts() }}
{% endblock %}

{% block body %}
    <form action="{{ pager.pathForm() }}" method="post">
        <table class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th>{{ helper.orderBy( pager, 'firstname', 'Firstname' ) }}</th>
                    <th>{{ helper.orderBy( pager, 'lastname', 'Lastname' ) }}</th>
                    <th>{{ helper.orderBy( pager, 'job', 'Job' ) }}</th>
                    <th>{{ helper.orderBy( pager, 'moviesNb', 'Number of movies' ) }}</th>
                </tr>
                <tr>
                    <th>{{ helper.filter( pager, 'firstname' ) }}</th>
                    <th>{{ helper.filter( pager, 'lastname' ) }}</th>
                    <th>{{ helper.filter( pager, 'job' ) }}</th>
                    <th>{{ helper.filter( pager, 'moviesNb' ) }}</th>
                </tr>
            </thead>
            <tbody>
                {% for person in pager.items %}
                    <tr>
                        <td>{{ person.firstname }}</td>
                        <td>{{ person.lastname }}</td>
                        <td>{{ person.job }}</td>
                        <td>{{ person.moviesNb }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>

        {# Allows submitting filters with 'Enter' #}
        <input type="image" src="{{ asset('bundles/gloomypager/img/transparent.gif') }}" height="0" width="0" border="0">

        {{ helper.paginate( pager ) }}
    </form>
{% endblock %}

INSTALLATION ------------ ### 1. Install with composer composer.phar require "gloomy/pager-bundle" "dev-master" ### 2. Modify your app/AppKernel.php ``` php <?php //... $bundles = array( //... new Gloomy\PagerBundle\GloomyPagerBundle(), );

3. Install assets (Optional)

php app/console assets:install web --symlink

The Versions

08/04 2014

dev-master

9999999-dev https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

11/12 2013

0.9.6

0.9.6.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

29/11 2013

0.9.5

0.9.5.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

12/11 2013

0.9.4

0.9.4.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

27/06 2013

0.9.3

0.9.3.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

12/03 2013

0.9.2

0.9.2.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

28/02 2013

0.9.1

0.9.1.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager

05/02 2013

0.9

0.9.0.0 https://github.com/iamluc/GloomyPagerBundle

Paginator/datagrid/crud bundle for Symfony2 with advanced filtering & sorting

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

rest crud paging pagination paginator datagrid pager