SpambotUserSpamPageController.php in Spambot 8
File
src/Controller/SpambotUserSpamPageController.php
View source
<?php
namespace Drupal\spambot\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\user\UserInterface;
class SpambotUserSpamPageController extends ControllerBase {
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,
];
}
}