LennardF1989
Member
Which method do I use to complete replace a stock ControllerPublic. As in, not extend upon it, but completely rewrite it?
I figure there are two methods to this:
1. Replace the stock route (eg. login) in an add-on to point to your custom ControllerPublic, is that even possible?
2. Extend and override all the methods using a Listener
Option 1 obviously seems the best, but is it really? Did I miss another potential trick to achieve the same result?
I want to replace XenForo_ControllerPublic_Login with the following logic (for testing purposes, I should add):
I figure there are two methods to this:
1. Replace the stock route (eg. login) in an add-on to point to your custom ControllerPublic, is that even possible?
2. Extend and override all the methods using a Listener
Option 1 obviously seems the best, but is it really? Did I miss another potential trick to achieve the same result?
I want to replace XenForo_ControllerPublic_Login with the following logic (for testing purposes, I should add):
PHP:
class MyAddon_ControllerPublic_Login extends XenForo_ControllerPublic_Abstract
{
public function actionIndex()
{
die("Hello!");
}
}