1. Go to this page and download the library: Download uspdev/forms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
uspdev / forms example snippets
$form = [
'name' => 'contact_form', // chave de acesso ao form'group' => config('uspdev-forms.defaultGroup'), // permite agrupar vários forms'description' => 'A form for user inquiries.',
'fields' => [
[
'name' => 'codpes',
'type' => 'pessoa-usp',
'label' => 'Pessoa (select2)',
' => 'rating',
'type' => 'select',
'label' => 'Avaliação (select)',
'options' => [
'1', '2', '3', '4', '5'
]
],
[
'name' => 'message',
'type' => 'textarea',
'label' => 'Mensagem (textarea)',
],
],
];
FormDefinition::create($form);
useUspdev\Forms\Forms;
$form = new Form($key = null, ['action' => route('sua-rota-do-action')]);
$formHtml = $form->generateHtml('contact_form'); // conforme definido em $form// ....
publicfunctionstore(Request $request){
$form = (new Form())->handleSubmission($request);
// ....
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.