CodeIgniter Forums
Want to use config array, but need variable as validated field - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Want to use config array, but need variable as validated field (/showthread.php?tid=38760)



Want to use config array, but need variable as validated field - El Forum - 02-17-2011

[eluser]Calvin Froedge[/eluser]
I have a custom functions for checking unique & existing values. They get passed from my model for the current (in this case, coupon).

Code:
$this->form_validation->set_rules('coupon_name', $this->lang->line('coupons_form-add-coupon-label-coupon-name'), 'trim|required|min_length[5]|max_length[45]|xss_clean|unique[subscription_coupons.coupon_name.'.$coupon_info->coupon_name.']');

I have moved all my other validation rules to my config file, and I'd like to move these too. I think my only option is to call my model in my config file, but that seems really dirty. Any thoughts?


Want to use config array, but need variable as validated field - El Forum - 02-18-2011

[eluser]Calvin Froedge[/eluser]
Bump...Anybody?