XF 2.3 Help to extends Account Controller

shqawe

Member
I'm trying to extends Account controller for one of my addons but i'm facing problem with that

This is how i extends the controller:

PHP:
namespace shqawe\myaddon\XF\Pub\Controller;

class AccountController extends XFCP_AccountController
{
    // some functions
}

Class extension configurations at ACP:

Base class name:
XF\Pub\Controller\AccountController
Extension class name:
shqawe\myaddon\XF\Pub\Controller\AccountController

but once i enable this extension and visit any link in user account i get this error

Code:
Error: Class "shqawe\myaddon\XF\Pub\Controller\XFCP_AccountController" not found in src/addons/shqawe/myaddon/XF/Pub/Controller/AccountController.php at line 8

But if i extends the actual class i mean like this
PHP:
namespace shqawe\myaddon\XF\Pub\Controller;

class AccountController extends \XF\Pub\Controller\AccountController
{
    // some functions
}

Every things work fine but i think this will be conflicts with other addons as @Chris D mentioned in this post


Is there any solution for this issue by the way i didn't got this error in previous versions 2.2.x just in 2.3 and above.
 
I tried to extends MemberController and it's work like a charm but when i extends AccountController it didn't work and i got above error i think maybe this is a bug or there is a special way to extends AccountController
 
@Siropu thanks for your reply i found the problem it was from the route once i delete it every things work fine. That's what happen when coding without a cup of coffee 😁.
 
Back
Top Bottom