2017 © Pedro Peláez
 

symfony-bundle sonata-ajax-block-bundle

Adds ajax functionality to the sonata block bundle.

image

fvchs/sonata-ajax-block-bundle

Adds ajax functionality to the sonata block bundle.

  • Tuesday, February 21, 2017
  • by fvchs
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,029 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 81 % Grown

The README.md

Work in Progress., (*1)

Installation

Step 1: Download the Bundle

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)

Step 2: Enable the Bundle

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(),
        );

        // ...
    }

    // ...
}

Configuration

  • 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)

The Versions

21/02 2017

dev-master

9999999-dev https://github.com/Fvchs/SonataAjaxBlockBundle

Adds ajax functionality to the sonata block bundle.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Andre Fuchs

ajax sonata block