Checks if a parameter exists.
public hasParameter ( string $name ) : boolean | ||
$name | string | The parameter name |
return | boolean | The presence of parameter in container |
// check if a parameter `database_name` exists in the container if ($container->hasParameter('database_name')) { // do something }
// get the value of a parameter `app_name` from the container $appName = $container->getParameter('app_name');Package library: Symfony Dependency Injection Component.
public hasParameter ( string $name ) : boolean | ||
$name | string | The parameter name |
return | boolean | The presence of parameter in container |