class ExpressionLanguageProvider in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dependency-injection/ExpressionLanguageProvider.php \Symfony\Component\DependencyInjection\ExpressionLanguageProvider
Define some ExpressionLanguage functions.
To get a service, use service('request'). To get a parameter, use parameter('kernel.debug').
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\DependencyInjection\ExpressionLanguageProvider implements \Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface
Expanded class hierarchy of ExpressionLanguageProvider
File
- vendor/
symfony/ dependency-injection/ ExpressionLanguageProvider.php, line 25
Namespace
Symfony\Component\DependencyInjectionView source
class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface {
public function getFunctions() {
return array(
new ExpressionFunction('service', function ($arg) {
return sprintf('$this->get(%s)', $arg);
}, function (array $variables, $value) {
return $variables['container']
->get($value);
}),
new ExpressionFunction('parameter', function ($arg) {
return sprintf('$this->getParameter(%s)', $arg);
}, function (array $variables, $value) {
return $variables['container']
->getParameter($value);
}),
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExpressionLanguageProvider:: |
public | function |