Answer the question
In order to leave comments, you need to log in
How to access a controller action in yii2?
I need this action to be processed in the same way as with an Ajax request (
or rather, that ( Yii::$app->request->isAjax
) would work).
Answer the question
In order to leave comments, you need to log in
See how the getIsAjax() method works, and then add what you need to the request (header||parameter).
A question the answer. Move the code that executes if Yii::$app->request->isAjax is true to a separate method and call it where necessary. Just.
If not, specify the question - what exactly and how you want it to work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question