Hey guys I am a Drupal Noob so be easy on me. I have created several custom modules with different forms however I was all the time using either a hook_form or hook_output. I was wondering if I can use both in the same module.
I have one module that is supposed to first display a list of courseworks then after the user clicks on any of them it should generate a form for the given course ID.
The way that I generate the list of the students is using hook_output and the list gets generated. The view URL where this happens is this: /drupal/?q=lecturers/evaluate_student/
and the list generated for the courseworks is looks this:
<a href='?q=lecturers/evaluate_student/1/'>Evaluate: <b>Advanced Networking</b></a><br/>
This practically calls this same ID adding an extra parameter to the URL (/1/ in this case).
The way that I fetch this is using the args():
if (arg(2)) {
/* Get arguments from URL
*/
$coursework_id = arg(2);
}
Now I would like to generate a form using this ID without redirecting it to another Module. Can I create another hook_form here and call it, if yes how would I do that?
Thanks in advance, -D