You are here

public function SiteSettingEntityAddController::addForm in Site Settings and Labels 8

Presents the creation form for entities of given bundle/type.

Parameters

\Drupal\Core\Entity\EntityInterface $site_setting_entity_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 SiteSettingEntityAddController::addForm()
SiteSettingEntityAddController::add in src/Controller/SiteSettingEntityAddController.php
Displays add links for available bundles/types.

File

src/Controller/SiteSettingEntityAddController.php, line 96

Class

SiteSettingEntityAddController
Class SiteSettingEntityAddController.

Namespace

Drupal\site_settings\Controller

Code

public function addForm(EntityInterface $site_setting_entity_type, Request $request) {
  $entity = $this->storage
    ->create([
    'type' => $site_setting_entity_type
      ->id(),
  ]);
  return $this
    ->entityFormBuilder()
    ->getForm($entity);
}