L
L
Leopandro2016-02-24 22:14:25
Yii
Leopandro, 2016-02-24 22:14:25

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

2 answer(s)
M
maximilan, 2016-03-03
@maximilan

See how the getIsAjax() method works, and then add what you need to the request (header||parameter).

V
Vadim Stepanov, 2016-03-03
@Vdm17

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 question

Ask a Question

731 491 924 answers to any question