Welcome Guest, Not a member yet? Register   Sign In
Errors And Messages After Submit
#1

[eluser]victorche[/eluser]
This was always something not very easy for me in CI. Every time an user submits a form, there could be an error (no success) or message(if everything went Ok).

So there is some kind of error handling in CI, but I think it is only for php errors etc.
I know there are some libraries out there and in fact I am using one of them now. But all this seems very complicated to me. I mean ... they have some configs, some things like "error_prefix", "error_suffix".
I do not need these things. Besides, for example if I use ion_auth, there are other functions in this library for displaying errors and messages.
That's why I want to have a simple solution (small library I guess), which will be used simply and everywhere through my code. And I don't need html tags in it. I will have:
Code:
<div id="message">&lt;?php echo $message; ?&gt;</div>
And then I can style my message box with css, as I like it. No need of extra html tags.

Well maybe they are needed if you need different styles for error and message. And if that is the case, then Ok. But anyway I think it can be done with a couple of simple functions.

And my question is ... How this can be easily implemented in CI 2.0 ?
Maybe there is something new in the code about it ?
Or maybe someone knows a simple solution (like library) ?
#2

[eluser]boxyee[/eluser]
You could use form validation, which will help to output errors.
User guide page: http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html




Theme © iAndrew 2016 - Forum software by © MyBB