Jerry Pham
Jerry Pham

Reputation: 372

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!!!

Upvotes: 0

Views: 69

Answers (1)

Vincent Composieux
Vincent Composieux

Reputation: 524

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');

Upvotes: 1

Related Questions