Calling runaction between different modules in yii2



1、 Call the same controller under different action modules

// in the first mock exam of frontend\controllers\TestController\actionTest,
//Frontend / Controllers / newcontroller / actionnewaction method


2、 Call actions under different modules

// in the frontend\controllers\TestController\actionTest method, call another module.
//The method of backend / Controllers / newcontroller / actionnewaction
return (new NewController($this->id, $this->module))->runAction('new-action');


Recommended Today

Quickly create a document project with vitepress

In fact, to develop a project is the most necessaryOperation documentThe quality of documents determines the development process, development specification and so on. For the front-end framework, the document is the most friendlyvueIt is not only the framework of Chinese people, but also the document supports Chinese. Check Vue’s official documents, andVue-Router,Vuex,Vite. It is found […]