Pergunta

I want to easily get access to my Controller container everywhere. Is there an "official" way for doing this ?

I intend to create a static access function in the bundle class (or controller class) that returns the container. The container would be initialized in the controller's constructor.

Foi útil?

Solução

No, there is no "official" way to accomplish this and it is strongly discouraged. Your suggested approach will work but you will find it to be more useful to learn how to use Services.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top