0

How can I call controller in my observer like my observer function is this

  public function abcd{
              //some code///
     how to call controller here?
}

The controller function is execute and also there are parameters to pass (www.demo.com/test/test/test/order_id/1234) then how can I trigger or execute the controller?

one way is that I can simply use curl call to that controller but is there any other way?

1

1 Answer 1

0

It is generally bad idea to execute controller in observer. You can move the method to a helper class and inject the helper to the observer.

1
  • yes i know but is there any way?
    – Asad Ullah
    Jun 28, 2021 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.