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...
Then to process the form
//make sure you are passing the id in the form itself
//do any checks you want to do here
to ADD a row to that table...
Then to process the form
//do any checks you want to do here
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);