I need to use multi APEX controller in lightning component.

I thought I can use Controller Extension like visualforce page, but I couldn't.

I got error like Invalid attribute "extensions".

It isn't usable in Aura, or there are some solutions?

Developer Guide for Controller Extension in visualforce https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_extension.htm

2 Answers 2


You can't use multiple Apex-Controller in Lightning Components. But you can use your main controller as a start point to call functions from other Apex-controllers:


<aura:component controller="MainController">


public class MainController{

    public MainController() {


    public static String callFun2FromSubApexClass() {

And call the callFun2FromSubApexClass() from your the javascript controller


You cannot use multiple apex controllers in AURA (but you can in LWC). If you need to refer to refer methods from multiple classes, you can return them from base controller:

public static List<String> myMethod1() {
    return SomeOtherClass1.myMethod1();

public static List<String> myMethod2() {
    return SomeOtherClass2.myMethod2();

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .