Create an add-on in the Admin CP, let's say the ID is YourAddOn
Create a directory in library called YourAddOn
In that directory create a couple of extra directories (I like to mimic the layout of the XenForo directory structure as much as possible for my add-ons) -- the end result should be you have a library/YourAddOn/Route/Prefix directory.
In that directory create a file called YourPages.php (or similar).
class YourAddOn_Route_Prefix_YourPages implements XenForo_Route_Interface
* Match a specific route for an already matched prefix.
* @see XenForo_Route_Interface::match()
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
$action = $router->resolveActionWithStringParam($routePath, $request, 'page_name');
return $router->getRouteMatch('YourAddOn_ControllerPublic_Page', $action, 'yourpages');
* 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::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'page_name');
That's pretty much set up how you'd want it for your add-on, I think. Some of the stuff would need tweaking depending on what field names you use in the database etc.
Then go to Admin CP > Development > Route Prefixes