function AutowireTrait::create
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/DependencyInjection/AutowireTrait.php \Drupal\Core\DependencyInjection\AutowireTrait::create()
- 10 core/lib/Drupal/Core/DependencyInjection/AutowireTrait.php \Drupal\Core\DependencyInjection\AutowireTrait::create()
Instantiates a new instance of the implementing class using autowiring.
Parameters
\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.
Return value
static
13 methods override AutowireTrait::create()
- ApiController::create in core/
modules/ package_manager/ tests/ modules/ package_manager_test_api/ src/ ApiController.php - Instantiates a new instance of the implementing class using autowiring.
- BlockContentController::create in core/
modules/ block_content/ src/ Controller/ BlockContentController.php - Instantiates a new instance of the implementing class using autowiring.
- ConfigTranslationMapperList::create in core/
modules/ config_translation/ src/ Controller/ ConfigTranslationMapperList.php - Instantiates a new instance of the implementing class using autowiring.
- CssAssetController::create in core/
modules/ system/ src/ Controller/ CssAssetController.php - Instantiates a new instance of the implementing class using autowiring.
- DbUpdateController::create in core/
modules/ system/ src/ Controller/ DbUpdateController.php - Instantiates a new instance of the implementing class using autowiring.
File
-
core/
lib/ Drupal/ Core/ DependencyInjection/ AutowireTrait.php, line 25
Class
- AutowireTrait
- Defines a trait for automatically wiring dependencies from the container.
Namespace
Drupal\Core\DependencyInjectionCode
public static function create(ContainerInterface $container) {
return static::createInstanceAutowired($container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.