Coduo\TuTu\ServiceContainer::hasParameter PHP Method

hasParameter() public method

public hasParameter ( $id ) : boolean
$id
return boolean
    public function hasParameter($id)
    {
        return array_key_exists($id, $this->parameters);
    }

Usage Example

Beispiel #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;
 }