private function FormBase::container in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::container()
- 9 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::container()
Returns the service container.
This method is marked private to prevent sub-classes from retrieving services from the container through it. Instead, \Drupal\Core\DependencyInjection\ContainerInjectionInterface should be used for injecting services.
Return value
\Symfony\Component\DependencyInjection\ContainerInterface The service container.
1 call to FormBase::container()
- FormBase::configFactory in core/
lib/ Drupal/ Core/ Form/ FormBase.php - Gets the config factory for this form.
File
- core/
lib/ Drupal/ Core/ Form/ FormBase.php, line 227
Class
- FormBase
- Provides a base class for forms.
Namespace
Drupal\Core\FormCode
private function container() {
return \Drupal::getContainer();
}