Created
August 26, 2016 00:39
-
-
Save danaenz/8f254e295471bec900663deee9bd9207 to your computer and use it in GitHub Desktop.
Example required fields validator, conditional based on a type field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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