Normally we will control or retrieve data in controller for frontend. But backend is different, we need control on table
file path: administrator/components/com_ur_component/src/Table/urcomponentTable.php
example path
Then click inside, u direct search for ( $task == 'save' ), since we want to control when it save
Inside this, you can start to retrieve the data, you can retrieve 2 type of data, before user editing and after user editing.
You need create a variable with static:
static $x = 0;
<<ur code here>>
$x += 1;
This is because it will run multiple time, first time is before user editing, second time is after user editing
1. If you want retrieve data before user editing:
Then u just create a condition, when the x == 0, then read the $array and do ur code
2. If you want retrieve data after user editing:
Then u just create a condition, when the x == 1, then read the $array and do ur code
Summary:
-Create a variable to control when you want to retrieve the data.
-$array is the variable that stores the user's submitted data.