From a custom service Class, I can easily get an argument defined in the services.yaml file by inject the service ParameterBagInterface in the constructor of my service class like this :
#from the services.yaml
...
services:
...
App\Utils\myCustomService:
arguments:
$faa: 'some value'
...
//from my custom service Class
...
public function __construct(ParameterBagInterface $faa){
dump($faa); //print 'some value';
}
But for some reason, I want use a 'normal' parameter in the constructor of my service like this :
//from my custom service Class
...
public function __construct($aNormalParameter){
// do some stuff with $aNormalParameter
// but I also want to work with the $faa value located in the services.yaml file, how can I do that ?
}
//from a custom Controller
...
public function home(){
$myCustomService = new App\Utils\myCustomService("blabla");
}
So my question, how can I access to an argument I defined in the services.yaml file without inject the ParameterBagInterface service in the constructor ?
Thank you :)