views:

143

answers:

1

Hi guys,

I want to override the validation_errors() method of the form helper in CodeIgniter for one controller only, so that it will display a single error message (as a sentence in plain english) instead of the detailed line item summary. I've tried defining a validation_errors() function in my controller, which is what I usually do with Silverstripe's Sapphire framework, but this won't with CI.

What's the best way to override methods for a case by case basis?

+1  A: 

You can create a MY_Form_helper.php in your application/helpers/ folder and create that function in there and then when you load the form helper, it should also load your function.

For more information read the '"Extending" Helpers' section on: http://codeigniter.com/user_guide/general/helpers.html

ocdcoder
I just found that then - great, I've done this and added a couple of custom validation summary generators to the helper. Thanks :)
pingu