[Flow] Routes and controller redirects

Bastian Waidelich bastian at typo3.org
Mon Oct 14 10:49:24 CEST 2013


Stephen Bungert wrote:

Hi Stephen,

> I have found a solution, that is to add '@format': 'html' and add
> appendExceedingArguments: true

Yes, the format is required in this case, but "appendExceedingArguments" 
should only be set if you want to use arbitrary query arguments - thus 
it should only be used for filtering/searching in most of the cases.

If your route is really:


-
   name:            'Record: Edit'
   uriPattern:      'record/{record}/edit'
   defaults:
     '@package':    'Vendor.Package'
     '@controller': 'Controller'
     '@action':     'edit'
     '@format':     'html'
   httpMethods: ['GET']
   routeParts:
     record:
       objectType:  'Vendor\Package\Domain\Model\Record'
       uriPattern:  '{title}-({creator.fullName})'

And your controller code

$this->redirect('edit', 'Controller', NULL, array('record' => $record));


Everything should work if you used the right parameters.
If something does not work as expected, make sure to check the system 
log at Data/Logs/System_<Context>.log
If you disabled the Flow fallback routes (which you should always do for 
a custom app) you should see something like:


13-10-14 10:41:48  WARNING   Flow                 Router resolve(): 
Could not resolve a route for building an URI for the given route values.
     record => object: Vendor\Package\Domain\Model\Record
     @action => edit
     @controller => controller
     @package => vendor.package

Probably the log contains another value and that's why 
"appendExceedingArguments" fixes the issue for you

-- 
Bastian Waidelich
--
Core Developer Team

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


More information about the Flow mailing list