Setting controller variable from view?

Permalink
I couldn't find any good docs on how to set a variable in a controller from a view of a single page, other than using the url which I feel is less than ideal. Thoughts?

12345j
 
jordanlev replied on at Permalink Reply
jordanlev
You can't just call $this->controller->variable_name = whatever?
(Or does that only work in block views?)
12345j replied on at Permalink Reply
12345j
I hadn't tried that- didn't know about it actually- but ended up solving this with a hidden post field. Thanks for the suggestion though.
jordanlev replied on at Permalink Reply
jordanlev
Oh, I see -- you want to set a controller variable *after* a form is posted -- then your solution of using a hidden POST field is the way to go.
Calling $this->controller->whatever would not carry over to subsequent page calls or form posts, unless you called a function in the controller that saved the data to the database and then retrieved it later.