Skip to content

Instantly share code, notes, and snippets.

@mergeweb
Last active May 11, 2016 13:36
Embed
What would you like to do?
<?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