Changes
Title
unchanged
Load data from internal/external source to fill form fields
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
get, json, form, Jquery, Remote Data, lifedup
Content
changed
[...]
use yii\helpers\Html;
use yii\web\Response;
public function actionGetLocationAddress($id) {
Yii::$app->response->format = Response::FORMAT_JSON;
//echo JSON data for Get request to read
//always want to encode user input
echo Locations::find()->where('id = :id', [':id' => $id])->one();
}
```
Since the function is camelCased you should note that it needs to accessed like.
userlocations/get-location-address[...]