PHP code example of astral-php / astral-form

1. Go to this page and download the library: Download astral-php/astral-form 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/ */

    

astral-php / astral-form example snippets


use Astral\Form\FormServiceProvider;

return [
    FrameworkServiceProvider::class,
    DatabaseServiceProvider::class,
    AppServiceProvider::class,
    FormServiceProvider::class,
];

<?= $form->field(
    name: 'email',
    label: 'Adresse e-mail',
    value: $old['email'] ?? '',
    errors: $errors ?? [],
    options: ['type' => 'email', '

<?= $form->select(
    name: 'role',
    choices: ['user' => 'Utilisateur', 'admin' => 'Administrateur'],
    selected: $old['role'] ?? 'user',
    errors: $errors ?? [],
) 
bash
composer