Reputation: 928
Is there a way to do without the package name in the parts of the system as View or Routing?
For example, I want to use instead:
{% extends "SomeAppBundle::layout.html.twig" %}
Use this:
{% extends "layout.html.twig" %}
Or:
$router->add('index', new Route('/', array(
'_controller' => 'SomeAppBundle:Default:index',
)));
Replace:
$router->add('index', new Route('/', array(
'_controller' => 'Default:index',
)));
I did not fully understood the compulsion to bundles, but I think that this approach is more obvious for applications with single bundle. Why specify bundle name if I'm in the space of this bundle?
Upvotes: 1
Views: 63
Reputation: 13189
The symfony docs say:
Before you begin, you'll need to create a bundle. In Symfony2, a bundle is like a plugin, except that all of the code in your application will live inside a bundle.
If you have the rare case of having really only one bundle, than you may see this as overhead. But even then there are advantages:
I would advice you to work with the framework, creating one bundle even if it's the only one. You won't really feel it once you created it and it makes things so much easier.
Upvotes: 1