Evaelis
Active member
Hello there!
I actually want to create a custom page for my addon. So I first added it to the navbar :
Then I needed to create a route, as I don't need any params at the moment here is the code :
Here are the question :
First the getRouteMatch use my DonatorHandler_ControllerPublic_Donation which call a responseView.
What is the ViewPublic used for ? What can I modify with it ?
I took the basic code from the Member page (I left the userNotFound for my test)
I actually want to create a custom page for my addon. So I first added it to the navbar :
PHP:
class DonatorHandler_Navigation_Tabs
{
public static function addNavbarTab(array &$extraTabs, $selectedTabId)
{
$extraTabs['donation'] = array(
'title' => new XenForo_Phrase('donatorhandler_navbar_title'),
'href' => XenForo_Link::buildPublicLink('donation'),
'selected' => ($selectedTabId == new XenForo_Phrase('donatorhandler_navbar_title')),
'position' => 'end'
);
}
}
PHP:
class DonatorHandler_Route_Prefix_Public implements XenForo_Route_Interface
{
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
return $router->getRouteMatch('DonatorHandler_ControllerPublic_Donation', 'index', 'donation');
}
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
return XenForo_Link::buildBasicLink($outputPrefix, $action, $extension);
}
}
Here are the question :
First the getRouteMatch use my DonatorHandler_ControllerPublic_Donation which call a responseView.
PHP:
class DonatorHandler_ControllerPublic_Donation extends XenForo_ControllerPublic_Abstract
{
public function actionIndex()
{
$viewParams = array(
'userNotFound' => true,
);
return $this->responseView('DonatorHandler_ViewPublic_Donation_View', 'donation', $viewParams);
}
}
PHP:
class DonatorHandler_ViewPublic_Donation_View extends XenForo_ViewPublic_Base
{
public function renderHtml()
{
}
}
I took the basic code from the Member page (I left the userNotFound for my test)