protected function registerFunctions() { parent::registerFunctions(); $this->register('is_granted', function ($attributes, $object = null) { return '$security_context->isGranted($attributes, $object)'; }, function (array $variables, $attributes, $object = null) { return $variables['security_context']->isGranted($attributes, $object); }); }
protected function registerFunctions() { parent::registerFunctions(); $this->register('is_granted', function ($attributes, $object = 'null') { return sprintf('$auth_checker->isGranted(%s, %s)', $attributes, $object); }, function (array $variables, $attributes, $object = null) { return $variables['auth_checker']->isGranted($attributes, $object); }); }