[Flow] Routes and controller redirects

Christian Müller christian.mueller at typo3.org
Mon Oct 14 09:27:40 CEST 2013


Hi Stephen,

Stephen Bungert wrote:
> I have just started setting up routes and find that redirects don't seem
> to use my configuration.
>
> I have a route for edit:
>
> -
> name: 'Record: Edit'
> uriPattern: 'record/{record}/edit'
> defaults:
> '@package': 'Vendor.Package'
> '@controller': 'Controller'
> '@action': 'edit'
> httpMethods: ['GET']
> routeParts:
> record:
> objectType: 'Vendor\Package\Domain\Model\Record'
> uriPattern: '{title}-({creator.fullName})'
>
> This doesn't work, my controller's redirect in create/update looks like:
>
> $this->redirect('edit', 'Controller', NULL, array('book' => $book));

The controller argument name doesn't match the dynamic route part name 
(record vs. book) so there is no match. You need to adapt one or the 
other so that the route part name is the same as the controller 
argument. Then it should work.

Cheers,
Christian


-- 
Christian Müller
Flow / Neos Team Community Contact

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the Flow mailing list