Example #1
0
<?php

use Onephile\Form;
$Form = new Form();
$Form->processCallback = function ($Form) {
    $valid = $Form->validate();
    $values = $Form->getValues();
    print_r($values);
    return $valid;
};
$Form->addItem('hello', array('type' => 'markup', 'value' => '<strong>Hello World!</strong>'));
$Form->addItem('name', array('type' => 'text', 'label' => 'Your Name', 'info' => 'Enter Your Name Here', 'required' => true));
$Form->addItem('comments', array('type' => 'textarea', 'label' => 'Description', 'info' => 'Enter Some Comments'));
$Form->addItem('submit', array('type' => 'submit', 'value' => 'Send Us Your Info', 'attrs' => array('class' => 'btn btn-primary')));
echo get_class($Form);