Skip to content

Configuration

The configuration applies when SilarhiTurboBundle is registered. Every option is optional (default values shown):

config/packages/silarhi_turbo.yaml
silarhi_turbo:
base_template: 'base-frame.html.twig' # template the turbo_frame filter falls back to
follow_delete_redirects: true # convert DELETE-request redirects to a Turbo-Location visit
Option Type Default Effect
base_template string 'base-frame.html.twig' Template the turbo_frame filter returns inside a matching frame, when neither a base template argument nor a -frame sibling applies. Cannot be empty.
follow_delete_redirects boolean true Convert a redirect answered to a Turbo DELETE request into a Turbo-Location visit (DELETE redirects). Turned off, the redirect gets a 303. Frames with data-turbo-follow-redirect keep their redirects.

Unknown keys are rejected.

Service id (class) Tag Registered
Silarhi\TurboBundle\TurboManager (autowired) always
Silarhi\TurboBundle\EventListener\TurboFrameListener kernel.event_subscriber always
Silarhi\TurboBundle\TurboStreamBuilder always
Silarhi\TurboBundle\TurboStreamCollector (autowired) always
Silarhi\TurboBundle\EventListener\TurboStreamListener kernel.event_subscriber always
Silarhi\TurboBundle\EventListener\TurboFrameMissingListener kernel.event_subscriber when kernel.debug is on, with the logger service
Silarhi\TurboBundle\Twig\TurboExtension twig.extension when twig/twig is installed
Silarhi\TurboBundle\TurboStreamRenderer when twig/twig is installed

The services are private: inject TurboManager or TurboStreamCollector by its class name to read the Turbo headers of the current request in your own code (PHP API).