-
Notifications
You must be signed in to change notification settings - Fork 1
Form
Guilherme Capilé edited this page Oct 12, 2021
·
1 revision
/* title: Form (Tecnodesign_Form) */
Validate and display forms.
$form = new Tecnodesign_Form([
'method' => 'post',
'fields' => [
'field_name' => [
'label' => 'Field Name',
'type' => 'text',
'value' => 'default value', // optional
],
],
]);The options below are available for configuration
-
idRegister an update form? (optional) -
buttonsButtons available on form. If false, it will show no buttons. If is a string it will be used as label for the submit button. If is an array it will be appended to the default submit button as submit buttons. To change thetypeanclassuse the format['button' => 'Genereic Button', 'reset' => 'Reset Buttton'](optional, default:['submit' => '*Send']) -
actionAction to be used (optional, default: the current URL) -
methodMethod to be used (optional, default:post) model-
fieldsArray of fields to be used attributes
Each field in the form configuration can have the following options
-
credentialCredential to give access to the field
See Tecnodesign_Form_Field for more options
if ( ($post = Tecnodesign_App::request('post')) && $form->validate($post)) {
// process the $post
}