Skip to content

AbstractController->render errors if templating is disabled #23181

Closed
@BPScott

Description

@BPScott
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.2

I have disabled the templating system by not mentioning it in my FrameworkBundle config as I wish to use twig directly (yay perf improvements). I would also like to use the new AbstractController so it is clear what dependencies my controllers have.

However when i try to load a page i get the following error:

(1/1) ServiceNotFoundException
The service "templating.engine.twig" has a dependency on a non-existent service "templating.name_parser".
in CheckExceptionOnInvalidReferenceBehaviorPass.php (line 31)
at CheckExceptionOnInvalidReferenceBehaviorPass->processValue(object(Reference), false)
in AbstractRecursivePass.php (line 57)
at AbstractRecursivePass->processValue(array(object(Reference), object(Reference), object(Reference)), false)
in CheckExceptionOnInvalidReferenceBehaviorPass.php (line 35)
at CheckExceptionOnInvalidReferenceBehaviorPass->processValue(array(object(Reference), object(Reference), object(Reference)))
in AbstractRecursivePass.php (line 64)
at AbstractRecursivePass->processValue(object(Definition), true)
in CheckExceptionOnInvalidReferenceBehaviorPass.php (line 35)
at CheckExceptionOnInvalidReferenceBehaviorPass->processValue(object(Definition), true)
in AbstractRecursivePass.php (line 57)

I think this is due to the AbstractController containing 'templating' => '?'.EngineInterface::class, in its list of subscribed services - when I remove that line my page renders as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions