• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How do I create a URL with two parameters?

KenSmith

Active member
#1
I'm trying to get my head around the possibilities for Route_Prefix.

I'm currently using URLs such as
mysite.com/tournaments/123/view
to view tourn_id 123.

Code:
?php
class TournCalendar_Route_Prefix_Tournaments implements XenForo_Route_Interface
{
  public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
  {
     $action = $router->resolveActionWithIntegerParam($routePath, $request, 'tourn_id');
     return $router->getRouteMatch('TournCalendar_ControllerPublic_Tournament', $action, 'tournaments');
  }

  /**
  * Method to build a link to the specified page/action with the provided
  * data and params.
  *
  * @see XenForo_Route_BuilderInterface
  */
  public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
  {
     return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'tourn_id', 'event_name');
  }
}
Easy enough, but now I need something like this:
mysite.com/tournaments/123/attendees/2013-10-01
to see the attendees for tournament 123 on the specific date 10/1/2013.

Is there a standard way to handle this kind of URL?
Would this normally be handled like this instead?:
mysite.com/tournaments/123/attendees/?date=2013-10-01