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-05-12 20:54:15 UTC


README

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656e6f73702f666f726d6275696c6465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e7376673f7374796c653d666c61742d737175617265

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