ui-awesome/html-field

HTML Awesome Field for PHP.


README

UI Awesome Field for PHP.


PHPUnit Codecov Infection Psalm Psalm Coverage Style ci

This library provides a way to generate HTML code for various types of form fields, including text, text area, selection, checkbox, radio, and all input types.

<?php

declare(strict_types=1);

use App\Model\BasicForm;

echo Field::widget(new BasicForm(), 'fruits')
    ->input(
        CheckboxList::widget()
            ->items(
                Checkbox::widget()->label('Apple')->value(1),
                Checkbox::widget()->label('Banana')->value(2),
                Checkbox::widget()->label('Orange')->value(3),
            )
    )
    ->render()

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist ui-awesome/html-field:^0.1

or add

"ui-awesome/html-field": "^0.1"

to the require section of your composer.json file.

Usage

Check the documentation docs to learn about usage.

Testing

Check the documentation testing to learn about testing.

Support versions

PHP81

License

The MIT License (MIT). Please see License File for more information.

Our social networks

Twitter