I have parameters in my yml :
// myparameter.yml
parameters:
keekbootstrap4.color:
blue:
- color1
- color2
red:
- color1
- color2
In my Controller, I want to get the "blue" key :
/**
* @Route("/keekbootstrap4-card-{color}.css", requirements={"color" = "%keekbootstrap4.color%"}, name="keekbootstrap4_card")
*/
public function indexAction()
{
dump($this->container->getParameter('keekbootstrap4.color')[$color]);
But I have this error :
The container parameter "keekbootstrap4.color", used in the route configuration value "%keekbootstrap4.color%", must be a string or numeric, but it is of type array.
Can you help me ? It's possible to get array with key in Route url ? Thanks :)
requirements={"color": "%keekbootstrap4.color.blue.0%"|"%keekbootstrap4.color.blue.1%"}orrequirements={"color": "%keekbootstrap4.color.blue.0%|%keekbootstrap4.color.blue.1%"}