You are here

public function HomeboxController::add in Homebox 8

Provides the reference submission form.

Parameters

\Drupal\homebox\Entity\HomeboxInterface $homebox: The homebox.

Return value

array A homebox layout submission form.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 string reference to 'HomeboxController::add'
homebox.routing.yml in ./homebox.routing.yml
homebox.routing.yml

File

src/Controller/HomeboxController.php, line 56

Class

HomeboxController
Class HomeboxController.

Namespace

Drupal\homebox\Controller

Code

public function add(HomeboxInterface $homebox) {
  $entity = $this
    ->entityTypeManager()
    ->getStorage('homebox_layout')
    ->create([
    'type' => $homebox
      ->id(),
  ]);
  return $this
    ->entityFormBuilder()
    ->getForm($entity);
}