public function ForwardFormBuilder::buildInlineForm in Forward 4.0.x
Same name and namespace in other branches
- 4.x src/Services/ForwardFormBuilder.php \Drupal\forward\Services\ForwardFormBuilder::buildInlineForm()
Builds an inline Forward form for a given entity.
When rendered, the form will be inside a collapsible fieldset.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: Entity for which the form is being built.
Return value
array A render array for the form inside a details element.
Overrides ForwardFormBuilderInterface::buildInlineForm
File
- src/
Services/ ForwardFormBuilder.php, line 258
Class
- ForwardFormBuilder
- Defines a class for building markup for a Forward inline form on an entity.
Namespace
Drupal\forward\ServicesCode
public function buildInlineForm(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->time, $this->emailValidator);
$details = TRUE;
$render_array = $this->formBuilder
->getForm($form, $details);
}
return $render_array;
}