I would like to create a full page with a custom module. I mean a page that should not reside within the larger Drupal page. How can I achieve this?
This is the code I am using.
mymodule.module
function mymodule_menu() {
$result = array();
$result['mymodule'] = array(
'title' => "Some Title",
'page callback' => "mymodule_function",
'access callback' => true,
'type' => MENU_NORMAL_ITEM,
'weight' => 1,
);
return $result;
}
function mymodule_function() {
print theme('my_custom_template');
exit;
}
function mymodule_theme() {
return array(
'my_custom_template' => array(
'template' => 'mymodule-page',
),
);
}
mymodule-page.tpl.php
<html>
<head>
</head>
<body>
Hello World
</body>
</html>
This works fine enough, but is this the correct method? I also wonder how I would include forms (submit data, retrieve data, display that data, etc)?