CodeIgniter: custom validation rules can't be in a helper?

后端 未结 2 1219
执笔经年
执笔经年 2021-01-16 14:04

I\'ve created a \"validation helper\" that was supposed to have all my custom validation rules. The problem is that when I use them in my form validation, they seem to be ig

2条回答
  •  生来不讨喜
    2021-01-16 14:34

    A function in a helper and a controller are different obviously.

    Create an extended MY_Form_validation.php in your libraries/, add the functions there and finally set the rules without callback_ and just their function name.

    Example:

提交回复
热议问题