The Streams Platform provides a powerful value handler pattern that let's you defer the value or something to a
resolver service makes it easy to resolve the value from such handlers.
resolver is usually used in other parts of the system so it's helpful to understand how it works even though you may not use it directly.
This section will show you what a resolver is and how to use it.
Handlers is a generic term for a class that handles the value for something.
Where a typical attribute in an array might look like:
$array = [ 'example' => 'Test', ];
handler might look like this:
$array = [ 'example' => 'Example\[email protected]lue', ];
A value can also define a self handling handler:
$array = [ 'example' => Example\TestHandler::class, // Assumes 'Example\[email protected]' ];
To start resolving values in your class you need to include the
resolve method recursively resolves values within the
target value. The
target is called through the Service Container and supports class and method injection.
|$target||true||string||none||The value handler.|
|$arguments||false||array||null||The arguments to pass to the handler.|
|$options||false||array||null||Options for the resolver.|
$resolver->resolve('Example\[email protected]', compact('entry'));
method- The handler method when no method is defined. Defaults to