PHPackages                             astral-php/astral-form - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. astral-php/astral-form

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

astral-php/astral-form
======================

Form helpers and partials for Astral MVC.

0.1.0(1mo ago)00MITPHPPHP ^8.0

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/astral-php/astral-form)[ Packagist](https://packagist.org/packages/astral-php/astral-form)[ RSS](/packages/astral-php-astral-form/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

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
-------------

[](#compatibilite)

- PHP: `^8.0`
- Astral MVC: `^1.1`

Installation
------------

[](#installation)

```
composer require astral-php/astral-form
```

Dans `config/dependencies.php`:

```
use Astral\Form\FormServiceProvider;

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

Le provider enregistre:

- `Astral\Form\FormBuilder` dans le container
- `$form` partage global dans toutes les vues via `View::share()`

Usage rapide
------------

[](#usage-rapide)

```

```

Avec un select:

```

```

API du FormBuilder
------------------

[](#api-du-formbuilder)

- `field(string $name, string $label, mixed $value = null, array $errors = [], array $options = []): string`
- `input(string $type, string $name, mixed $value = null, array $errors = [], array $options = []): string`
- `textarea(string $name, mixed $value = null, array $errors = [], array $options = []): string`
- `select(string $name, array $choices, mixed $selected = null, array $errors = [], array $options = []): string`
- `label(string $name, string $text, array $options = []): string`
- `error(string $name, array $errors, string $class = '...'): string`
- `hasError(string $name, array $errors): bool`
- `firstError(string $name, array $errors): ?string`
- `attributes(array $attributes): string`

Partials fournis
----------------

[](#partials-fournis)

Les partials sont proposes dans `views/astral-form/partials/`:

- `field.php`
- `input-text.php`
- `select.php`
- `textarea.php`

Exemples
--------

[](#exemples)

Des exemples complets sont disponibles dans `examples/`:

- `login.php`
- `register.php`
- `profile.php`

Tests
-----

[](#tests)

Depuis la racine du projet Astral:

```
vendor/bin/phpunit --configuration components/astral-form/phpunit.xml
```

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42ebb0b0285cecf0b4af99da81fa9a19b2beb48668fcab4157d5490e329a010a?d=identicon)[astral-php](/maintainers/astral-php)

---

Top Contributors

[![astral-php](https://avatars.githubusercontent.com/u/267969862?v=4)](https://github.com/astral-php "astral-php (1 commits)")

---

Tags

phpvalidatortailwindformastral

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/astral-php-astral-form/health.svg)

```
[![Health](https://phpackages.com/badges/astral-php-astral-form/health.svg)](https://phpackages.com/packages/astral-php-astral-form)
```

###  Alternatives

[form-manager/form-manager

PHP-HTML form manager

16041.0k7](/packages/form-manager-form-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
