Scharesoft
Active member
I'm creating an addon for our forum and there I need the current route.
I created a new area with the url "tes". There will be sub areas like tes/skyrim or tes/oblivion. Now I need this route (skyrim or oblivion) in my actionIndex of the ControllerPublic php file.
Route/Prefix file:
ControllerPublic file
It would be possible to create a new actionXYZ for each route, but I think it's better to handle it in the actionIndex.
How to get the current route? Many thanks in advance!
I created a new area with the url "tes". There will be sub areas like tes/skyrim or tes/oblivion. Now I need this route (skyrim or oblivion) in my actionIndex of the ControllerPublic php file.
Route/Prefix file:
PHP:
class TESPortalGameInformation_Route_Prefix_Game implements XenForo_Route_Interface
{
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$controller = 'TESPortalGameInformation_ControllerPublic_Game';
return $router->getRouteMatch($controller, '', 'tes');
}
}
ControllerPublic file
PHP:
class TESPortalGameInformation_ControllerPublic_Game extends XenForo_ControllerPublic_Abstract
{
public function actionIndex()
{
$params = array( ... );
return $this->responseView('TESPortalGameInformation_ViewPublic_Game', 'tesportal_game_info', $params);
}
}
How to get the current route? Many thanks in advance!
Last edited: