You are here

public function ForwardController::buildForm in Forward 8

Same name and namespace in other branches
  1. 8.3 src/Controller/ForwardController.php \Drupal\forward\Controller\ForwardController::buildForm()
  2. 8.2 src/Controller/ForwardController.php \Drupal\forward\Controller\ForwardController::buildForm()

Build a Forward form when accessed as a separate page through the router.

Parameters

EntityInterface $entity: The entity being forwarded.

Return value

array The render array for the form.

1 string reference to 'ForwardController::buildForm'
forward.routing.yml in ./forward.routing.yml
forward.routing.yml

File

src/Controller/ForwardController.php, line 51

Class

ForwardController
Returns responses for the Forward module.

Namespace

Drupal\forward\Controller

Code

public function buildForm(EntityInterface $entity) {

  // Force the "link" interface so the Forward form page doesn't build inside a fieldset
  $settings = $this
    ->config('forward.settings')
    ->get();
  $settings['forward_interface_type'] = 'link';
  return $this->formBuilder
    ->buildForwardEntityForm($entity, $settings);
}