In my job I am dealing with a legacy app running on ZF2. There is a model which is sending out a variety of different emails to difference addresses. The one thing they have in common is they all need to BCC to one particular address.
At first, in my head I was cursing the previous developer, for foolishly hard coding the email address 20 different times in one file. I assumed that it would be a piece of cake to grab an application config with a simple call $this->config->get(‘x’) (like in Laravel) or something along them lines. Now I find myself feeling bad, because I understand why the previous dev did hard code the email addresses.
So to the question, how the hell do I grab a config item from application.config.php inside the model? I keep reading about how I need to implement the ServiceLocaterAware Interface. Is this really necessary? There must be a way to grab configs easily, surely?!?