Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// ...
use Formjack\Rule\When;
$form = new Form('Contact_Form', array(
/* ... */
new EmailField('email', array(
'label' => 'Email: ',
'rules' => array(
new When(function($data){
return !is_user_logged_in();
}, array(
new NotEmpty('Please enter your email address.'),
new Email('Given email address is not valid.')
/* ... */
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.