0
votes

I am working on building API in YII controller, we have a comment module which is an extension . I want to access comment extension's controller so that I can use the same functionality to be accessed for my API instead of creating one.

Can anyone tell me how can i do it?

Actually I am working on making API for my website. Where I have created a controller for API and accessing other controllers for functionality already exists. There's a functionality that exist in comment-module in extensions. And i need to access that Controller in comment-module. Hope this cleared my question asked above. And I need to access this function via Ajax as well, if possible. But should be accessed via API controller.

Specifying in case any confusion. My requirements would be:

  • accessing methods of comment-module controller in only 1 method in API Controller. In order to make my functionality centeralized.
  • comment-module should itself keep working.
  • and work with API controller as well.

Note: Please explain your solutions as well, I am not a genius in yii like you.

1

1 Answers

0
votes

Move common functions into treat or inherit controller from extension.