Last active
May 11, 2016 13:36
-
-
Save mergeweb/36665e7a9b2bf918b5e4835cb2d9813c to your computer and use it in GitHub Desktop.
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 | |
$fields = [ | |
'title' => 'Your listing needs a title', | |
'insurer_id' => 'Please specify an Insurer' | |
]; | |
$rules = []; | |
foreach($fields as $field => $message){ | |
$rules['location_' . $field] = [ | |
'rule' => 'validateNotEmpty', | |
'on' => [$this, 'onNotDraftStatus'], | |
'pass' => [$field], | |
'message' => $message | |
]; | |
} | |
return $rules; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment