You are here

protected function ControllerBase::formBuilder in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::formBuilder()

Returns the form builder service.

Return value

\Drupal\Core\Form\FormBuilderInterface

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 252
Contains \Drupal\Core\Controller\ControllerBase.

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

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