benosp/formbuilder

BenOSP(Abass Ben Cheik Open-Source Project) php form builder

v1.0.17 2021-11-13 16:38 UTC

This package is auto-updated.

Last update: 2024-07-12 21:05:46 UTC


README

Installation

$ composer require benosp/formbuilder

Basic usage

require_once './vendor/autoload.php';

$form = (new \BenOSP\FormBuilder)

->add('text', [
   'name' => "subject",
   "label" => "📝"

])->add("text", [
    "name" => "level",
    "label" => "📶"
    
])->add("dateTime", [
    "name" => "createdAt",
    "label" => "📆"

])->add("submit",[
    "name" => "➕"

])->buildAssets("assets/bootstrap/");

?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Form builder</title>
  <link rel="stylesheet" href="assets/bootstrap/dist/css/bootstrap.min.css">
 </head>
    <body class="container">
        <?php $form->build() ?>
    </body>
</html>

*NOTE You can delete the method below after running the script for the first time. This is to build the bootstrap script in the public/assets/ folder for example

buildAssets("assets/");

This form builder was already tested on the nigatedev framework to-do demo