0

New to Symfony2.

I followed several tutorials to install & configure Sonata with FOSUser and I generated a SonataUser bundle.

SonataAdmin seems to be designed to run on it's own in terms of templates.

Now I have an existing project and I'd like to use some parts of Sonata (user list/edit, group list/edit, ...) into my current project's interface.

I'm wondering the best way to do it.

I firstly though about extending my layout with Sonata templates to keep advantage of the maintainability but there are many things that I don't need (like the top nav bar, breadcrumbs, ...).

I also though about calling parts of Sonata but I don't really know how to it, and I'm not sure it's a good idea.

Could someone point me to the right direction ?

Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307

1 Answers1

1

You can overrride any and all parts of a bundle's functionality. For template changes, you just need to copy the templates into app/Resources (using the correct directory structure) and Symfony2 will look there for the templates first. To override a bundle's classes/methods, just extend the bundle's class and add whatever code you like. Your routing just needs to be set up to point at your classes rather than the bundle's.

It's all explained well here:

http://symfony.com/doc/current/cookbook/bundles/inheritance.html

http://symfony.com/doc/current/book/templating.html#overriding-bundle-templates

Pappa
  • 1,593
  • 14
  • 20