You are here

public function BibciteEntityController::add in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Controller/BibciteEntityController.php \Drupal\bibcite_entity\Controller\BibciteEntityController::add()

Provides the reference submission form.

Parameters

ReferenceTypeInterface $bibcite_reference_type: The reference type entity for the reference.

Return value

array A reference submission form.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 string reference to 'BibciteEntityController::add'
bibcite_entity.routing.yml in modules/bibcite_entity/bibcite_entity.routing.yml
modules/bibcite_entity/bibcite_entity.routing.yml

File

modules/bibcite_entity/src/Controller/BibciteEntityController.php, line 26

Class

BibciteEntityController
Returns responses for Bibcite routes.

Namespace

Drupal\bibcite_entity\Controller

Code

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