Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Formatting Error Messages
  • Hello, I've got a problem trying to format the error messages from validation. In the docs it says to add a section called 'validation' in the config file and to add a few variables.
    My config file is here: http://pastebin.com/Lzs0rLmr
    The section for validation is line 169. As you can see I want to surround all my validation errors with <p class="form_error">...</p> however it isn't happening. How can I solve this?
    Thanks
  • The validation config should not be in your config.php, it should be in app/config/validation.php. And whether or not the result is formatted depends on the method called:
    - error() will return the raw error message or messages
    - show_errors() will return a list of formatted errors
    - get_message() on a Validation_Error obect also returns the formatted message
  • Hi Harro, Thanks for the amswer. I didn't realize that error() didn't show formatted errors. Thanks a lot.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion