Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: userc865b
Added: Jan 31, 2018 2:08 PM
Modified: Jan 31, 2018 2:20 PM
Views: 23
Tags: symfony
setParameterInConateiner
  1.   private function injectRouteParamterIntoServicesFile($city): void {
  2.         $servicesYmlPath = '/home/osboxes/PhpstormProjects/symfony/testaufgabe/app/config/services.yml';
  3.         $servicesArrayRepr = Yaml::parseFile($servicesYmlPath);
  4.         $servicesArrayRepr['parameters']['city'] = $city;
  5.         $ymlRepr = Yaml::dump($servicesArrayRepr,2);
  6.         file_put_contents($servicesYmlPath, $ymlRepr);
  7.     }