getParameter() public method

public getParameter ( $id ) : mixed
$id
return mixed
Example #1
0
 /**
  * If value is valid string between "%" characters then it might be a parameter
  * so we need to try take it from container.
  *
  * @param $value
  * @return mixed
  */
 private function getValue($value)
 {
     if (!is_string($value)) {
         return $value;
     }
     if ($value[0] != '%' || $value[strlen($value) - 1] != '%') {
         return $value;
     }
     $parameter = trim($value, '%');
     if ($this->container->hasParameter($parameter)) {
         return $this->container->getParameter($parameter);
     }
     return $value;
 }