Download the PHP package astral-php/astral-form without Composer
On this page you can find all versions of the php package astral-php/astral-form. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package astral-form
astral-form
Helpers et partials de formulaires pour Astral MVC.
astral-form fournit un FormBuilder léger, sans dependance front
supplementaire, pour generer des champs HTML coherents avec Tailwind
et afficher les erreurs issues de Core\Validator.
Compatibilite
- PHP:
^8.0 - Astral MVC:
^1.1
Installation
Dans config/dependencies.php:
Le provider enregistre:
Astral\Form\FormBuilderdans le container$formpartage global dans toutes les vues viaView::share()
Usage rapide
Avec un select:
API du FormBuilder
field(string $name, string $label, mixed $value = null, array $errors = [], array $options = []): stringinput(string $type, string $name, mixed $value = null, array $errors = [], array $options = []): stringtextarea(string $name, mixed $value = null, array $errors = [], array $options = []): stringselect(string $name, array $choices, mixed $selected = null, array $errors = [], array $options = []): stringlabel(string $name, string $text, array $options = []): stringerror(string $name, array $errors, string $class = '...'): stringhasError(string $name, array $errors): boolfirstError(string $name, array $errors): ?stringattributes(array $attributes): string
Partials fournis
Les partials sont proposes dans views/astral-form/partials/:
field.phpinput-text.phpselect.phptextarea.php
Exemples
Des exemples complets sont disponibles dans examples/:
login.phpregister.phpprofile.php
Tests
Depuis la racine du projet Astral:
License
MIT
All versions of astral-form with dependencies
PHP Build Version
Package Version
The package astral-php/astral-form contains the following files
Loading the files please wait ...