Search code examples
symfonyblocksonata-admin

SonataAdminBundle new block type


Did anybody create new block type for SonataAdminBundle using extend bundle? I'm trying to do so but it only works if I add service directly in original block.xml. Anything change in block.xml under config directory in MyBundle (extended SonataAdminBundle) has no effect.

Any one has solution? Plz help!!!


Solution

  • Are you sure that your XML file is correctly loaded in your own bundle?

    It must be done in the load() method declared in file MyBundle\DependencyInjection\MyBundleExtension.php:

    $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
    $loader->load('block.xml');