Skip to content

Instantly share code, notes, and snippets.

@yantze
Created July 21, 2015 02:49
Show Gist options
  • Save yantze/ab303dfc97a0345f990e to your computer and use it in GitHub Desktop.
Save yantze/ab303dfc97a0345f990e to your computer and use it in GitHub Desktop.
dynamic model
$phoneset = '';
$content = '';
$type = 'uid';
$types = [
'uid' =>'使用uid',
'phone'=>'电话号码',
];
$model = DynamicModel::validateData(compact('phoneset', 'content', 'type', 'types'), [
['phoneset', 'string', 'min' => 11],
['content', 'string', 'max' => 340, 'min' => 2],
['type', 'string'],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment