S
S
sanex33392015-02-25 22:30:58
Yii
sanex3339, 2015-02-25 22:30:58

How to get the previously set parameter or module property with ajax request?

I got a problem. I need to call the method of the main file of the module, assign a certain parameter to the module, no matter which way, through params[] or through the class property. And then get the value of this parameter when making an Ajax request to the controller action of this module. It is important to know that I am passing this parameter in the parameter of the called module method. The module method itself is called in View. I did not find a solution, but I found a temporary cycle through sessions, but now I needed to pass it as a parameter yii \ db \ ActiveQuery with configured select, where, orderBy, etc. and it's no longer safe.
The chain is as follows: in the view I call the module method, I pass it to the module - yii\db\ActiveQuery, then in the module I shove yii\db\ActiveQuery into the module property, I call the module controller action in which, based on yii\db\ActiveQuery, I fetch data from models. Then the model is displayed, and so on. This is on page load.
And I also have to update the data of this model via ajax, respectively, I knock with Ajax directly on the action of the module controller, and I need to get yii\db\ActiveQuery, and update the model data.
I don’t write the source code here, because it seems that it is not needed, I explained everything in detail, but here is a link to these 2 files on github:
Module file: https://github.com/sanex3339/Simple-Yii ... Filter.php
Module controller file, the desired action is the bottom one , actionShowDataPost()
https://github.com/sanex3339/Simple-Yii ... roller.php

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Vorotnev, 2017-11-18
@HeadOnFire

Nginx doesn't support .htaccess, it's an Apache config file.

E
Evgeny Vorobyov, 2017-11-18
@lokki00003

Something like this in your .htaccess should be
RewriteRule ^ getUser/(.*)$ ./getUser.php/$1 [L,QSA]
This line should be deleted or commented out

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question