09-03-2017, 03:47 AM
Could anyone tell me a little bit about this Dynamic Form Generation feature?
The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Dynamic Form Generation
|
09-03-2017, 03:47 AM
Could anyone tell me a little bit about this Dynamic Form Generation feature?
09-03-2017, 11:20 AM
Its gone over here:
https://userspice.com/documentation-functions/ I've never really used it - other than just using it to look at the function. @Mudmin might be able to explain it better
09-03-2017, 12:45 PM
Yeah. There are a few auto generation features. The best ones are the ones that are designed to update the database (deal with $_POST), unless you want to have all fields be text. I'm probably not explaining that very well.
So let's say you have a table called "assets" with 20 columns in it. You would do something like this... To EDIT a particular row of the assets table... Code: $t = 'assets'; Code: $skip = ['id']; Code: generateForm($t,$id,$skip); Code: $id = Input::get('id'); //do any checks you want to do here Code: $skipFields = ['create_type']; Code: $updateFields = updateFields2($_POST, $skipFields); Code: $db->insert('assets',$updateFields); Code: $db->update('assets',$id,$updateFields); to ADD a row to that table... Code: $t = 'assets'; Code: $skip = ['id']; Code: generateAddForm($t,$skip); Then to process the form //do any checks you want to do here Code: $skipFields = ['create_type']; Code: $updateFields = updateFields2($_POST, $skipFields); Code: $db->insert('assets',$updateFields);
09-03-2017, 02:20 PM
I acknowledge that this is very much to my knowledge almost nil. This function is not for me, @Mudmin, @Brandin thank you guys.
09-03-2017, 02:30 PM
We're happy to help if you give a little more info for what you're trying to do.
|