S
S
slavagoreev2014-11-15 11:57:47
MySQL
slavagoreev, 2014-11-15 11:57:47

AJAX Requests yii, how to proceed?

Good afternoon,
Vopchem need advice from experienced people. I am creating a project in yii and actually there is a form for adding a new item to the list under this form. I have a choice: either load the yii page (as it is written in the guide to the framework. It just takes and completely reloads the whole framework to add one field to the database), or simply connect to another file and do a pdo class to it to connect to the database . A lot of actions go through ajax requests, so it’s not worth reloading the entire structure of the framework every time. Please tell me how best to organize such requests so that everything works as it should even under load.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
# artur #, 2014-11-15
@slavagoreev

The block in which the value from the form enters must be displayed in a separate view and wrapped in a div:
When loading the page, load the controller with the ajax view and display the result in block
If the entry is successfully added, make a request to the controller again and again display the result in block .e. how to update

R
ryzhak, 2014-11-15
@ryzhak

$this->renderPartial() ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question