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?
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.
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.
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.
(Or does that only work in block views?)