Download the PHP package pugx/filter-bundle without Composer

On this page you can find all versions of the php package pugx/filter-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 filter-bundle

PUGX FilterBundle

Total Downloads Build Status

The purpose of this bundle is providing a way to get some filters, that stay in session, to be able to use them when displaying a list of items. It also supports sorting.

Setup

Run composer require pugx/filter-bundle. No configuration is required.

Basic Usage

Inject provided service in your controller and use it with a form.

Your form should use GET as method, use some fields that make sense on your list of item, and not use CSRF protection.

First step is to save filter with a name (if form is submitted). Then, you can get a key/value array in $filter->filter('foo'), where "foo" is the name you provided above.

Using such array to retrieve filtered value is up to you: this bundle makes no assumptions on your domain and doesn't do magic.

Here is an example:

Form Example

Sorting

You can use provided Twig extension for column sorting functionality.

Example of template:

You need to provide a route/action to perform sorting, using $filter->sort('foo', $field, $direction).

Then, you'll find an addtional value inside your filter array, like this:

You can use this value to perform your sorting (again, this is up to you and it depends on your domain logic).

Translation

Translations are available (for now, only for English/French/Italian).

If you're using Symfony 4.4+, translatons should be automatically discovered.

On older Symfony versions, add this to your configuration:

JavaScript

A jQuery helper is provided, to enhance UX. You can use it by requiring the following line in your package.json file:

Then you can do something like the following:

The basic results will be that icon in the toggle button will be toggled along, and the arrow will point to right when filters are shown (and back to bottom when filters are collapsed).

You can pass an option object to pugxFilter function.

Currently supported options are:

If you prefer vanilla js with Bootstrap, you can use the following snippet:

Helpers

Following helper functions are available as functions in twig templates:


All versions of filter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/config Version ^6.4 || ^7.0
symfony/dependency-injection Version ^6.4 || ^7.0
symfony/form Version ^6.4 || ^7.0
symfony/http-kernel Version ^6.4 || ^7.0
twig/twig Version ^3.8
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 pugx/filter-bundle contains the following files

Loading the files please wait ....