You are here

public function ExpressionLanguageProvider::getFunctions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/ExpressionLanguageProvider.php \Symfony\Component\DependencyInjection\ExpressionLanguageProvider::getFunctions()

File

vendor/symfony/dependency-injection/ExpressionLanguageProvider.php, line 27

Class

ExpressionLanguageProvider
Define some ExpressionLanguage functions.

Namespace

Symfony\Component\DependencyInjection

Code

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);
    }),
  );
}