Hi!
I'm building a module that fetches data from WebServices using cURL and then renders HTML using that data.
In the hook_menu implementation I've defined path(s) containing a "auto-loader" wildcard as stated on http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
For example, I'm doing something like this:
<?php
function stuff_menu() {
$items['stuff/%stuff'] = array(
'page callback' => 'stuff_page_view',
'page arguments' => array(1),
);
return $items;
}
function stuff_load($name) {
$stuff = stuff_api_load($name);
if ($stuff === FALSE) {
return FALSE;
}
return (object) $stuff;
}
?>
This seems to work great. What confusing me is that hook_load seems to be a hook in the node module or has something to do with the entity API.
I'm not making use of either of thoose in my module, still the name "stuff_load" confirms to the rules for being an implementation of hook_load?
Also, in "stuff_page_view" (menu callback) I want to do something similar to what the node module does (letting other modules hook in to modify the renderable array before being rendered).
My first thought was to do something like this:
<?php
function stuff_page_view($stuff) {
$stuff->content = array();
$stuff->content['description'] = array(
'#theme' => 'description',