You are here

public function ViewsMegarowEditController::form in Views Megarow 8

1 string reference to 'ViewsMegarowEditController::form'
views_megarow.routing.yml in ./views_megarow.routing.yml
views_megarow.routing.yml

File

src/Controller/ViewsMegarowEditController.php, line 13

Class

ViewsMegarowEditController

Namespace

Drupal\views_megarow\Controller

Code

public function form() {

  // Extra arguments are in $_REQUEST.
  $request = Drupal::service('request_stack');
  $current_request = $request
    ->getCurrentRequest();
  $entity_type = $current_request
    ->get('entity_type');
  $entity = $current_request
    ->get('entity');
  $operation = 'edit';
  $build = [];
  $form = \Drupal::service('entity.manager')
    ->getFormObject($entity_type, $operation)
    ->setEntity($entity);
  $build[] = \Drupal::formBuilder()
    ->getForm($form);
  return $build;
}