ClassResolverInterface::getInstanceFromDefinition

public ClassResolverInterface::getInstanceFromDefinition($definition)

Returns a class instance with a given class definition.

In contrast to controllers you don't specify a method.

Parameters

string $definition: A class name or service name.

Return value

object The instance of the class.

Throws

\InvalidArgumentException If $class is not a valid service identifier and the class does not exist.

File

core/lib/Drupal/Core/DependencyInjection/ClassResolverInterface.php, line 24

Class

ClassResolverInterface
Provides an interface to get a instance of a class with dependency injection.

Namespace

Drupal\Core\DependencyInjection

Code

public function getInstanceFromDefinition($definition);
doc_Drupal
2016-10-29 08:50:02
Comments
Leave a Comment

Please login to continue.