function UserThemeHooks::preprocessBlock
Same name and namespace in other branches
- 11.x core/modules/user/src/Hook/UserThemeHooks.php \Drupal\user\Hook\UserThemeHooks::preprocessBlock()
Implements hook_preprocess_HOOK() for block templates.
Attributes
#[Hook('preprocess_block')]
File
-
core/
modules/ user/ src/ Hook/ UserThemeHooks.php, line 156
Class
- UserThemeHooks
- Hook implementations for user.
Namespace
Drupal\user\HookCode
public function preprocessBlock(&$variables) : void {
if ($variables['configuration']['provider'] == 'user') {
switch ($variables['elements']['#plugin_id']) {
case 'user_login_block':
$variables['attributes']['role'] = 'form';
break;
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.