Thursday, March 26, 2015

3.0 -- Pagination Helper with Custom Routes causes Missing Route Exception!

I'm trying to use the pagination helper, but it's causing missing route exception when used with any method that tries to generate a link.

my route code looks like this:

Router::prefix('manage', function ($routes) {
$routes->connect('/:organizationNeedle',['controller'=>'Organizations','action' => 'dashboard']);
$routes->connect('/:organizationNeedle/:controller',['action' => 'index']);
$routes->connect('/:organizationNeedle/:controller/:action/*');
});

The error I get is:

Error: A route matching "array ( 'page' => NULL, 'action' => 'index', 'prefix' => 'manage', 'plugin' => NULL, 'controller' => 'Containers', '_ext' => NULL, )" could not be found.

None of the currently connected routes match the given URL or parameters. Add a matching route to config\routes.php

The passed context was:

[  	'_base' => '',  	'_port' => '80',  	'_scheme' => 'http',  	'_host' => 'vlife.v4',  	'params' => [  		'plugin' => null,  		'controller' => 'Containers',  		'action' => 'index',  		'_ext' => null,  		'pass' => [],  		'organizationNeedle' => 'test',  		'prefix' => 'manage',  		'paging' => [  			'Containers' => [  				[maximum depth reached]  			]  		]  	]  ]

If anyone has any ideas on how to fix this, I'd love to hear it. I've raked through the router api and paginator api for both the component and the helper and I'm not seeing a way to make this work.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: