简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM