Skip to content

Instantly share code, notes, and snippets.

@danaenz
Created August 26, 2016 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danaenz/8f254e295471bec900663deee9bd9207 to your computer and use it in GitHub Desktop.
Save danaenz/8f254e295471bec900663deee9bd9207 to your computer and use it in GitHub Desktop.
Example required fields validator, conditional based on a type field
<?php
class CustomValidator extends RequiredFields
{
public function php($data)
{
if ($data['Type'] == 'Video') {
$this->addRequiredField('VideoImage');
}
return parent::php($data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment