public function MessageController::add in Message UI 8
Generates form output for adding a new message entity of message_template.
Parameters
\Drupal\message\MessageTemplateInterface $message_template: The message template object.
Return value
array An array as expected by drupal_render().
1 string reference to 'MessageController::add'
File
- src/
Controller/ MessageController.php, line 77
Class
- MessageController
- Controller for adding messages.
Namespace
Drupal\message_ui\ControllerCode
public function add(MessageTemplateInterface $message_template) {
$message = Message::create([
'template' => $message_template
->id(),
]);
$form = $this
->entityFormBuilder()
->getForm($message);
return $form;
}