public function ForwardFormBuilder::buildForm in Forward 4.x
Same name and namespace in other branches
- 4.0.x src/Services/ForwardFormBuilder.php \Drupal\forward\Services\ForwardFormBuilder::buildForm()
Builds a Forward form for a given entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: Entity for which the form is being built.
boolean $details: TRUE if the form should be built inside a details element.
Return value
array A render array for the form.
Overrides ForwardFormBuilderInterface::buildForm
File
- src/
Services/ ForwardFormBuilder.php, line 214
Class
- ForwardFormBuilder
- Defines a class for building markup for a Forward inline form on an entity.
Namespace
Drupal\forward\ServicesCode
public function buildForm(EntityInterface $entity) {
$render_array = [];
if ($entity
->access('view')) {
$form = new ForwardForm($entity, $this->routeMatch, $this->moduleHandler, $this->entityTypeManager, $this->requestStack, $this->database, $this->tokenService, $this->floodInterface, $this->accountSwitcher, $this->renderer, $this->eventDispatcher, $this->mailer, $this->linkGenerator, $this->emailValidator);
$render_array = $this->formBuilder
->getForm($form);
}
return $render_array;
}