PHP code example of hypnokizer / formbuilder

1. Go to this page and download the library: Download hypnokizer/formbuilder 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/ */

    

hypnokizer / formbuilder example snippets


$f = new form();
$f->formAttr('class', 'myFormClass');

$f->setEditData($databaseresults);

$f->field('text', 'fname', 'First Name')->attr('class', 'myClassName');
$f->field('select', 'title', 'Title')->choices($titles);

$f->showObject();

$genders = array('male' => 'Male', 'female' => 'Female');

$f = new formbuilder();
$f->formAttr('id', 'myFormID')->formAttr('class', 'myclassname');

$f->setEditData($databaseresults);

$f->field('text', 'fname', 'First Name');
$f->field('text', 'lname', 'Last Name');
$f->field('text', 'age', 'Age');
$f->field('select', 'gender', 'Gender')->choices($genders);
$f->field('textarea', 'comments', 'Comments')->attr('rows', 5);
$f->field('submit', 'submit', 'Submit')->attr('class', 'css-style');

$f->showForm();