Skip to content

Instantly share code, notes, and snippets.

@DomagojGojak DomagojGojak/forms.php
Last active Aug 27, 2015

Embed
What would you like to do?
<?php
use Formjack\Form;
use Formjack\Field\TextField;
use Formjack\Field\EmailField;
use Formjack\Field\TextareaField;
use Formjack\Rule\NotEmpty;
use Formjack\Rule\Email;
$form = new Form('Contact_Form', array(
new TextField('first_name', array(
'label' => 'First Name: ',
'rules' => array(
new NotEmpty('Please enter your first name.')
)
)),
new TextField('last_name', array(
'label' => 'Last Name: ',
'rules' => array(
new NotEmpty('Please enter your last name.')
)
)),
new EmailField('email', array(
'label' => 'Email: ',
'rules' => array(
new NotEmpty('Please enter your email address.'),
new Email('Given email address is not valid.')
)
)),
new TextareaField('message', array(
'label' => 'Message: '
))
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.