Rapyd has some pretty useful validation rules. Pretty much all the ones that are in CodeIgniter + a few more
first create your edit grid
$edit = new dataedit_library(); $edit->label = $this->title; $edit->back_url = site_url('users_list'); $edit->source('user'); |
Here are some of the lesser well known ones:
unique[table_name] – if you use this validation rule, rapyd will make sure that the field you are using the rule on is unique in table_name
$edit->field('input','user_idnumber','ID Number') ->rule('exact_length[13]|unique[user]') ->rule('numeric'); |
valid_email – this will make sure the field is a valid email address
$edit->field('input','email','Email Address') ->rule('valid_email'); |
in_range[low,high] – this will make sure that the value you enter is between (low) and (high)
$edit->field('input','selling_incl','Selling (Incl VAT)') ->rule('required|in_range[' . $avg_cost . ',' . $real_value . ']'); |

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 
New Blog Post -> Rapyd – CRUD for PHP – Part 4 – Validation – http://www.zayinkrige.com/rapyd-crud-for…