function ControllerBase::entityFormBuilder

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::entityFormBuilder()
  2. 10 core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::entityFormBuilder()
  3. 11.x core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::entityFormBuilder()

Retrieves the entity form builder.

Return value

\Drupal\Core\Entity\EntityFormBuilderInterface The entity form builder.

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 131

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

protected function entityFormBuilder() {
    if (!$this->entityFormBuilder) {
        $this->entityFormBuilder = $this->container()
            ->get('entity.form_builder');
    }
    return $this->entityFormBuilder;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.