public function StatusAddController::addForm in Heartbeat 8
Presents the creation form for status entities of given bundle/type.
Parameters
EntityInterface $status_type: The custom bundle to add.
\Symfony\Component\HttpFoundation\Request $request: The current request object.
Return value
array A form array as expected by drupal_render().
1 call to StatusAddController::addForm()
- StatusAddController::add in modules/
statusmessage/ src/ Controller/ StatusAddController.php - Displays add links for available bundles/types for entity status .
File
- modules/
statusmessage/ src/ Controller/ StatusAddController.php, line 74
Class
- StatusAddController
- Class StatusAddController.
Namespace
Drupal\statusmessage\ControllerCode
public function addForm(EntityInterface $status_type, Request $request) {
$entity = $this->storage
->create(array(
'type' => $status_type
->id(),
));
return $this
->entityFormBuilder()
->getForm($entity);
}