abdfahim
Well-known member
I want to create a new miscellaneous page with the route "misc/new-page" which should follow the structure of Contact Us page (without the form). I don't need any thing to return as the page would be a static page with the content in the mytest_new_page template.
Is it enough to extend the XenForo_ControllerPublic_Misc class?
Library/MyTest/Extend/ControllerPublic/Misc.php:
Listener.php
Is it enough to extend the XenForo_ControllerPublic_Misc class?
Library/MyTest/Extend/ControllerPublic/Misc.php:
PHP:
class MyTest_Extend_ControllerPublic_Misc extends XFCP_MyTest_Extend_ControllerPublic_Misc
{
public function actionNewPage()
{
return $this->responseView('XenForo_ViewPublic_Misc_NewPage', 'mytest_new_page', null);
}
}
Listener.php
PHP:
class MyTest_Listener
{
public static function load_class_controller ($class, array &$extend)
{
if ($class == 'XenForo_ControllerPublic_Misc')
{
$extend[] = 'MyTest_Extend_ControllerPublic_Misc';
}
}
}