Answer the question
In order to leave comments, you need to log in
How to access an action via ajax in yii2?
I do it like this:
$.ajax({
url: 'http://mysite.ru/get-video',
data: {url: url},
success: function(data) {
alert(data);
}
});
public function actionGetVideo()
{
$url = Yii::$app->request->get('url');
echo $url;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question