use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
use Symfony\Component\Routing\Route;
/**
*/
protected $controllerResolver;
+ /**
+ * The argument resolver.
+ *
+ * @var \Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface
+ */
+ protected $argumentResolver;
+
/**
* Constructs a TitleResolver instance.
*
* The controller resolver.
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The translation manager.
+ * @param \Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface $argument_resolver
+ * The argument resolver.
*/
- public function __construct(ControllerResolverInterface $controller_resolver, TranslationInterface $string_translation) {
+ public function __construct(ControllerResolverInterface $controller_resolver, TranslationInterface $string_translation, ArgumentResolverInterface $argument_resolver) {
$this->controllerResolver = $controller_resolver;
$this->stringTranslation = $string_translation;
+ $this->argumentResolver = $argument_resolver;
}
/**
// trying to use empty values.
if ($callback = $route->getDefault('_title_callback')) {
$callable = $this->controllerResolver->getControllerFromDefinition($callback);
- $arguments = $this->controllerResolver->getArguments($request, $callable);
+ $arguments = $this->argumentResolver->getArguments($request, $callable);
$route_title = call_user_func_array($callable, $arguments);
}
elseif ($title = $route->getDefault('_title')) {