Farshid
Farshid

Reputation: 518

How can i use multi controller in one page?

How can I use multi controller in one page? I used:

Yii::$app->controller->action();

How can I access another controllers?

Upvotes: 0

Views: 196

Answers (1)

Mohammad Aghayari
Mohammad Aghayari

Reputation: 1160

You can create a new class and put your actions in the calass, after that create a object in the page you want to use it.

for example:

$object = new fontend\controllers\NewClassName;

$object -> YourAction();

Upvotes: 1

Related Questions