public function ErrorPageController::on403 in farmOS 2.x
The default 403 content.
Return value
array A render array containing the message to display for 403 pages.
Overrides Http4xxController::on403
1 string reference to 'ErrorPageController::on403'
- farm_ui_user.routing.yml in modules/
core/ ui/ user/ farm_ui_user.routing.yml - modules/core/ui/user/farm_ui_user.routing.yml
File
- modules/
core/ ui/ user/ src/ Controller/ ErrorPageController.php, line 15
Class
- ErrorPageController
- Provides a controller for error pages.
Namespace
Drupal\farm_ui_user\ControllerCode
public function on403() {
$output = parent::on403();
// If the user is already logged in, return.
if (!\Drupal::currentUser()
->isAnonymous()) {
return $output;
}
/** @var \Drupal\block\Entity\Block $block */
$block = $this
->entityTypeManager()
->getStorage('block')
->load('userlogin');
// Build the blocks renderable output.
$output['form'] = $this
->entityTypeManager()
->getViewBuilder('block')
->view($block);
return $output;
}