Reputation: 18856
How do I extract the bundle name from its short form to full, for example I want to convert AcmeDemoBundle
raw string to Acme\DemoBundle
bundle real namespace
Upvotes: 0
Views: 583
Reputation: 18856
We can get the bundle instance from our kernel by using getBundle
method, and then user getNamespace()
method to get the actual namespace of the bundle:
$this->container->get('kernel')->getBundle('AcmeDemoBundle')->getNamespace();
// gives me Acme/DemoBundle
Upvotes: 1