-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:any/:any #20
Comments
I refactored this an wildcards are still proving an issue: /**
* Topic based routing
*/
$topics = array('surf', 'skate', 'snow');
$contentTypes = array('articles', 'brands', 'places', 'promotions', 'tutorials');
$topicRoutes = array();
foreach($topics as $topic) {
// Create and index topic route
$topicRoutes[$topic] = function (\rsanchez\ResourceRouter\Router $router) use ($topic) {
$router->setTemplate('topics/index');
$router->setVariable('page_topic', $topic);
};
// Create routes for each topic / content type combo
foreach($contentTypes as $contentType) {
$topicRoutes[$topic . "/" . $contentType . "/:pagination"] = function (\rsanchez\ResourceRouter\Router $router) use ($topic, $contentType) {
$router->setTemplate('topics/' . $contentType);
$router->setVariable('page_content_type', $contentType);
$router->setVariable('page_topic', $topic);
};
}
}
$routes = array_merge($routes, $topicRoutes);
return $routes; In the case of
$query_string is being set to |
Ok found a work around which doesn't seem very intuitive is removing the
|
Sounds like a bug to me. I have to re-factor some things to make this easier to test before I can address the underlying issue, though. |
Ran into an interesting situation today. I have the following dynamic-ish routes:
I tried to clean up my routing with:
Unfortunately this didn't work in practice because :any is added to the query string here: https://github.com/rsanchez/resource_router/blob/master/system/expressionengine/third_party/resource_router/libraries/ResourceRouter/Router.php#L247
I'm wondering if the query string should only be build from segment_3 onwards?
The text was updated successfully, but these errors were encountered: