S
S
search742015-02-20 13:51:15
JavaScript
search74, 2015-02-20 13:51:15

How to send an ajax request to the same page I'm on?

Being on the page (url: "/calendar/25"), how can I send an ajax request to it, passing some parameter, for example, the date?

my controller:

public function actionCalendar($id){
    //нужно чтобы здесь было доступно и $id, и $date
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nastya Sukharik, 2015-02-20
@nastya_cyxarik

in the form in the inputs you pass the date and url parameters, and in the controller you parse the url with regular expressions and you will have an id, just make the controller without parameters

O
Oleg Titarenko, 2015-02-20
@olegtytarenko2

Logically, you can put a certain condition and return
return $this->content();

public function actionCalendar($id, $data = ''){
}

But it seems something like this =) And what version of yii?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question