1. Go to this page and download the library: Download ui-awesome/form-model 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/ */
ui-awesome / form-model example snippets
declare(strict_types=1);
namespace App\FormModel;
use UIAwesome\FormModel\BaseFormModel;
use UIAwesome\FormModel\Attribute\{FieldConfig, Hint, Label, Placeholder};
final class SignInForm extends BaseFormModel
{
#[Hint('Use your account email address.')]
#[Label('Email address')]
#[Placeholder('[email protected]')]
#[FieldConfig(['class' => ['w-full rounded-md border border-slate-300 px-3 py-2']])]
public string $email = '';
public string $password = '';
public function getHints(): array
{
return [
'password' => 'Use at least 8 characters.',
];
}
public function getLabels(): array
{
return [
'password' => 'Password',
];
}
public function getPlaceholders(): array
{
return [
'password' => 'Enter your password',
];
}
public function getRules(): array
{
return [
'email' => ['