CodeIgniter Forums
validation set message in config file - 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: validation set message in config file (/showthread.php?tid=20183)



validation set message in config file - El Forum - 07-01-2009

[eluser]polipspy[/eluser]
Hello

May I know what is the the key to set message in config file.
If I have this in my config/form_validation.php

$config = array(
array(
‘field’ => ‘username’,
‘label’ => ‘Username’,
‘rules’ => ‘required’
)

);

How do I add the set_message and set_error delimiters in the array?

$config = array(
array(
‘field’ => ‘username’,
‘label’ => ‘Username’,
‘rules’ => ‘required’
),
array(
‘rules’ => ‘unique_email’
‘message’ => ‘Email already registered’
)
);

Also how do I add the error delimiters in the array?

Thank you.


validation set message in config file - El Forum - 07-01-2009

[eluser]TheFuzzy0ne[/eluser]
I think you may need to override the constructor to get it to work the way you want it to, although I seriously doubt you'd be able to store error messages in the config file, since the message it usually defined within the callback method.