public function ContactAddController::addForm in RedHen CRM 8
Presents the creation form for redhen_contact entities of given bundle/type.
Parameters
\Drupal\Core\Entity\EntityInterface $redhen_contact_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 ContactAddController::addForm()
- ContactAddController::add in modules/
redhen_contact/ src/ Controller/ ContactAddController.php - Displays add links for available bundles/types for entity redhen_contact .
File
- modules/
redhen_contact/ src/ Controller/ ContactAddController.php, line 76
Class
- ContactAddController
- Class ContactAddController.
Namespace
Drupal\redhen_contact\ControllerCode
public function addForm(EntityInterface $redhen_contact_type, Request $request) {
$entity = $this->storage
->create([
'type' => $redhen_contact_type
->id(),
]);
return $this
->entityFormBuilder()
->getForm($entity);
}