function 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
32 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.
- CallsDestructableServiceController::create in core/
modules/ system/ tests/ modules/ destructable_test/ src/ Controller/ CallsDestructableServiceController.php - CKEditor5ImageController::create in core/
modules/ ckeditor5/ src/ Controller/ CKEditor5ImageController.php - Instantiates a new instance of the implementing class using autowiring.
- ConfigTranslationController::create in core/
modules/ config_translation/ src/ Controller/ ConfigTranslationController.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.