dev-master
9999999-dev https://github.com/Fvchs/SonataAjaxBlockBundleAdds ajax functionality to the sonata block bundle.
MIT
The Requires
- php >=5.3.0
by Andre Fuchs
ajax sonata block
Wallogit.com
2017 © Pedro Peláez
Adds ajax functionality to the sonata block bundle.
Work in Progress., (*1)
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*2)
$ composer require fvchs/sonata-ajax-block-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*3)
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php file of your project:, (*4)
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Fvchs\SonataAjaxBlockBundle\FvchsSonataAjaxBlockBundle(),
);
// ...
}
// ...
}
Replace the sonata.block.renderer to enable ajax loading, (*5)
# app/config/sonata_block.yml
services:
sonata.block.renderer: '@fvchs.sonata_ajax_block.renderer'
Add this to your routing configuration, (*6)
# app/config/routing.yml
fvchs_sonata_ajax_block:
resource: "@FvchsSonataAjaxBlockBundle/Resources/config/routing.yml"
prefix: /
Mark Blocks with the ajax attribute, (*7)
# app/config/sonata_admin.yml
sonata_admin:
dashboard:
blocks:
- { type: my.block.one, settings: { attr: [ajax: true] } }
- { type: my.block.two }
The first block in this example will be lazy loaded via ajax. The second block will stay static., (*8)
Adds ajax functionality to the sonata block bundle.
MIT
ajax sonata block