Answer the question
In order to leave comments, you need to log in
How to link frontend react app to backend?
How to connect frontend (in React) and backend (in Yii)? The bottom line: there is a frontend that includes a large form with fields: inputs, chboxes, text fields, etc. ... arrays of data for processing in the form are passed to me as a JSON file... no problem with that... problems with validation - it's implemented using Yii but how do I connect it with the react application if I initially render the entire page in 1 tag? Bagkender can't work with inputs because he doesn't see them from the beginning... please explain on your fingers)
Answer the question
In order to leave comments, you need to log in
make an API.
The frontend should call on the methods that the backend will provide and develop.
It will look like this
//front:
data = {"id":1,"name":"someName"}; //....
apiUrl = "/users/"+data.id;
sendAjax(apiUrl, data);
//back:
UsersController {
function actionUpdate($id) {
//load POST
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question