Hi! I have some view which lists my module table entries. What is the most elegant way to attach a form below the view to add record? Waht I am trying to do know is:
I created dedicated form in my module:
function my_module_form_add_record($form_state) { form fields.....
}
I added to the view theme file:
$add_form = drupal_get_form('my_module_form_add_record'); print $add_form;
But I do not like this solution for at least 2 reasons:
- I does not work ...
2. Even if it worked - it is depended on the theme file! So if I change the theme - functionality is crashed. I would like to find more elegant solution to attach form from custom module to the view.
I know of the existence of the "Views Attach" module but it has no option of adding custom forms. I know also of the existence of the Views Embedded form (and I am usig it) but it is only useful if you want to add form to the every row.
Seems the must be some solution to add record from the view page! Thanks you for help.