Given the following README.md documentation :
#[Route(methods: ['GET'], pattern: 'user/{user}')]
#[Transformer(
transformer: UserEntityTransfomer::class),
parameters: ['user' => User::class], // changed from the documentation, @see #27
)]
public function userAction($request, $response, $user): ResponseInterface {}
I understand that the {user} placeholder name, the parameters key ['user => User::class]in #[Transformer attribute and the $user parameter name in the userActionmethod must be the same.
Is there a way, given the example beside, to have the UserEntityTransfomer populate into $user the entity the userAction method the retrieved entity from the {user_slug} placeholder parameter ?
#[Route(methods: ['GET'], pattern: 'user/{user_slug}', placeholders: ['user_slug' => 'slug'])]
#[Transformer(
transformer: UserEntityTransfomer::class),
parameters: ['user' => User::class],
)]
public function userAction($request, $response, User $user): ResponseInterface {}
Given the following README.md documentation :
I understand that the
{user}placeholder name, the parameters key['user => User::class]in#[Transformerattribute and the$userparameter name in theuserActionmethod must be the same.Is there a way, given the example beside, to have the
UserEntityTransfomerpopulate into$userthe entity theuserActionmethod the retrieved entity from the{user_slug}placeholder parameter ?