I tried adding a function feedbackform to my page_controller and then call it from the template that i use to render the shortcode, but it does not show up. I guess the page_controller is not the right place, but where would I put the form?
Add the function that creates the form to your page_controller.
In the shortcode handler function use Controller::curr() to get a reference to the controller and call the function.
Add it's output to the dataarray passed to $template->process.
Thanks to the silversripte irc channel for the help!
Just wondering whether it's also possible to include the results of the processing of the form (e.g. function UserAction($data, $form)) from the same (or a different) short code handler? Anyone any ideas?
I've just recently completed something like this: a simple course-subscription form (using a custom template) that can be instantiated either from template or from a shortcode.
On submission it sets a session value and redirects, after which it again reads the session value (and clears it). Based on the session value it uses a custom template to either show the form or a success message. Basically very simple: just like you would normally go about creating a custom form, the only real extra is a very simple shotcode handler.