Download the PHP package gremo/pjax-bundle without Composer
On this page you can find all versions of the php package gremo/pjax-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pjax-bundle
GremoPjaxBundle
Symfony bundle that provide a lightweight yet powerfull integration with pjax jQuery plugin.
New contributors are welcome!
Installation
Add the bundle in your composer.json
file:
Then enable the bundle in the kernel:
Configuration
Integration is disabled by default, see "Usage" to find out which method you need to enable.
Short configuration:
Full configuration and defaults:
Usage
This bundle provides two different types of integration: annotations and controller injection.
Annotations
This is the most unobtrusive way and it's fully automatic:
- You don't need custom template logic or controller logic
- Response HTML is automatically filtered (if
filter
option istrue
) and a<title>
tag is injected in the pjax container fragment - Response time will slightly increase due to the filtering logic, but you still save bandwidth
Note: everything that is not a successfull response or text/html is simply ignored.
Available options:
version
(string
, defaultnull
): sets the pjax version (see Layout Reloading)filter
(bool
, defaulttrue
): whatever respose should contain only the pjax container or the full HTML
Note: annotations defined on a controller action inherit from class annotation and replace defaults from configuration.
The @Pjax
annotation on a controller class defines all action routes as pjax-aware:
Instead, on a controller action, the annotation defines the route as pjax-aware:
Controller injection
This is the most obtrusive way but potentially the most powerful one:
- You need to define the pjax action parameters (names are configurable)
- You need to define a custom template/controller logic for returing the full HTML or just the pjax container
- Extra logic allows to save queries and reduce the response time
All versions of pjax-bundle with dependencies
symfony/framework-bundle Version ~2.4|~3.0
symfony/dom-crawler Version ~2.4|~3.0
symfony/css-selector Version ~2.4|~3.0