1. Go to this page and download the library: Download nrep/form-forge library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nrep / form-forge example snippets
use FormForge\Fields\Field;
use FormForge\Form;
use FormForge\Renderers\TailwindRenderer;
// Create fields using fluent API
$form = Form::make()
->action('/submit')
->method('POST')
->schema([
Field::text('name')->label('Full Name')->a',
'ke' => 'Kenya',
'tz' => 'Tanzania',
'ug' => 'Uganda',
]),
Field::textarea('bio')->label('Bio')->rows(4),
Field::toggle('newsletter')->label('Subscribe to newsletter'),
]);
// Render with Tailwind CSS
$renderer = new TailwindRenderer();
echo $form->render($renderer);
Field::text('username')
->label('Username')
->placeholder('Enter username')
->hint('Must be unique')
->true']);