CodeIgniter Forums
Newbie question: how to pass errormessage from comment_insert() to comments() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Newbie question: how to pass errormessage from comment_insert() to comments() (/thread-2526.html)



Newbie question: how to pass errormessage from comment_insert() to comments() - El Forum - 08-10-2007

[eluser]See64[/eluser]
I am working with the "blog example", but I can't figure out how to send a error message from the comment_insert() to the comments() part. I want to check for empty fields and tell the user he has to fill in something.

So instead of the redirect to /blog/comments, I want to go jump to comments() and pass an error message, so that I can send it along to the comment_view.


Newbie question: how to pass errormessage from comment_insert() to comments() - El Forum - 08-10-2007

[eluser]Michael Wales[/eluser]
I haven't even looked at the blog example - but do some research into the Validation class, it should provide everything you need.


Newbie question: how to pass errormessage from comment_insert() to comments() - El Forum - 08-10-2007

[eluser]See64[/eluser]
[quote author="walesmd" date="1186774751"]I haven't even looked at the blog example - but do some research into the Validation class, it should provide everything you need.[/quote]

Thanks, I hadn't even thought of that. I was so focussed on transfering strings from one function to another in my controller, that I forgot about this obvious solution!