You are here

public function SpambotUserSpamPageController::spambotUserSpam in Spambot 8

Returns a render-able array for a spam page.

Parameters

\Drupal\user\UserInterface $user: The user who can be reported.

Return value

array Return form.

1 string reference to 'SpambotUserSpamPageController::spambotUserSpam'
spambot.routing.yml in ./spambot.routing.yml
spambot.routing.yml

File

src/Controller/SpambotUserSpamPageController.php, line 22

Class

SpambotUserSpamPageController
Returns a render-able array for a spam page.

Namespace

Drupal\spambot\Controller

Code

public function spambotUserSpam(UserInterface $user) {
  $myForm = $this
    ->formBuilder()
    ->getForm('Drupal\\spambot\\Form\\SpambotUserspamForm', $user);
  $renderer = \Drupal::service('renderer');
  $myFormHtml = $renderer
    ->render($myForm);
  return [
    '#markup' => $myFormHtml,
  ];
}