Welcome Guest, Not a member yet? Register   Sign In
Newbie question: how to pass errormessage from comment_insert() to comments()
#1

[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.
#2

[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.
#3

[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!




Theme © iAndrew 2016 - Forum software by © MyBB