1

I'm having trouble finding the correct tutorial for me. I'm trying to have a controller-configuration in my bundle in Resources/config/someconfig.yml. I already adjusted it to a .yml extension. Now I'm searching a solution to access this configuration inside a twig exception controller (404-pages) and merge this configuration with the config.yml in app/config/.

Can anybody help me with a tutorial link or tips?

Thank you!

user3631654
  • 1,735
  • 6
  • 22
  • 38
  • I am not clear on what is being asked for. Possibly this: http://symfony.com/doc/current/cookbook/bundles/configuration.html – Cerad Sep 01 '14 at 16:06

2 Answers2

1

To get Resources/config/someconfig.yml config you can create DI extension: http://symfony.com/doc/current/cookbook/bundles/extension.html

I think this can help you to get configuration value in view: How to get config parameters in Symfony2 Twig Templates

As an alternative you can override Exception controller (get configuration parameters there and pass them to the view): http://symfony.com/doc/current/cookbook/controller/error_pages.html#replace-the-default-exception-controller

Community
  • 1
  • 1
Sergei Gorjunov
  • 1,789
  • 1
  • 14
  • 22
0

For merging configurations among independent bundles you should use prependExtensionConfig method and PrependExtensionInterface interface.

Documentaion page How to Simplify Configuration of multiple Bundles explains this technique in great detail.

martin
  • 93,354
  • 25
  • 191
  • 226