I am so utterly confused. Can someone help me with a simple example of how to call a page with a custom form. I have a module lets call test.module. In that module my hook_menu has an item that calls a function and it looks like this:
$items[] = array('path' => 'test/add', 'title' => t('Test'),
'access' => user_access('view test'), 'callback' => 'test_add');
What I want is when the user clicks Test from the menu they go to a page with the form in question. This part works fine. That is to say I can get to the page and print some output. Where I am confused is what the code should be like to render a form on that page. I have read the api and tried examples and nothing has worked. Please help me. Is my menu callback wrong? What code should go inside my function to make a simple form. Any form. All I am trying to accomplish right now is to display a field. From their I am pretty sure I will be able to figure out the rest.
I would appreciate it if someone could build upon the code below and finish it so that when the user clicks the menu item a page with the field 'name' and a submit button is visible. Thanks in advance for your help.
<?php
function test_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'test/add', 'title' => t('Test'),
'access' => user_access('view test'), 'callback' => 'test_add');