Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Resources/doc/reference/configuration/headers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ checked in the order specified, where the first match wins.
# match all actions of a specific controller
-
match:
attributes: { _controller: ^AcmeBundle:Default:.* }
attributes: { _controller: ^Acme\\TestBundle\\Controller\\DefaultController::.* }
additional_cacheable_status: [400]
headers:
cache_control:
Expand Down
12 changes: 10 additions & 2 deletions Resources/doc/reference/configuration/match.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ _controller

Controller name regular expression. Note that this is the controller name used
in the route, so it depends on your route configuration whether you need
``Bundle:Name:action`` or ``service.id:methodName`` (if you defined your
`controllers as services`_).
``Acme\\TestBundle\\Controller\\NameController::hello`` or ``acme_test.controller.name:helloAction``
for `controllers as services`_.

.. warning::

Symfony always expands the short notation in route definitions. Even if you
define your route as ``AcmeTestBundle:Name:hello`` you still need to use
the long form here. If you use a service however, the compiled route still
uses the service name and you need to match on that. If you mixed both, you
can do a regular expression like ``^(Acme\\TestBundle|acme_test.controller)``.

_route
^^^^^^
Expand Down