On this page
[Obsolete] Naming standards for services and extending Symfony
This documentation is deprecated.
The standards have moved to GitLab pages, Drupal coding standards.
Manipulating the Request object:
Elements added to the attributes of the Request object by any Drupal module or service should have a "_" prepended unless they come from the path.
Example:
\Drupal::request()->attributes->set('_context_value', $myvalue); Only values that come from the path will have the "_" omitted, for example, the path pattern /node/{node}.
Drupal core and Symfony typically add some prefixed attributes that should not be overwritten by a contributed module. These include:
_system_path
_title
_account (Note that _account is being removed in #2073531: Use current user service instead of _account, remove _account from the request object.)
and from Symfony\Cmf\Component\Routing\RouteObjectInterface:
_route
_route_object
_controller
_contentSee the the original change notice.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion