* Our router maps this method to the path 'examples/page_example'.
*/
functiondescription(){
$build=array(
'#markup'=>t('<p>The page_example provides two pages, "simple" and "arguments".</p><p>The <a href="@simple_link">simple page</a> just returns a renderable array for display.</p><p>The <a href="@arguments_link">arguments page</a> takes two arguments and displays them, as in @arguments_link</p>',array('@simple_link'=>url('examples/page_example/simple',array('absolute'=>TRUE)),'@arguments_link'=>url('examples/page_example/arguments/23/56',array('absolute'=>TRUE))))
);
return$build;
}
/**
* Constructs a simple page.
*
* The simple _content callback, mapped to the path
* 'examples/page_example/simple'.
*
* _content callbacks return a renderable array with the content area of the
* page. The theme system will later render and surround the content in the
* appropriate blocks, navigation, and styling.
*
* @todo: Is this paragraph valid?
* If you do not want to use the theme system (for example for outputting an
* image or XML), just return the right response object.
*/
functionsimple(){
returnarray(
'#markup'=>'<p>'.t('Simple page: The quick brown fox jumps over the lazy dog.').'</p>'
);
}
/**
* A more complex _content callback that takes arguments.
// 'examples/page_example/arguments/{first}/{second}' because that is only a
// routing item, and not a menu item (which needs to appear on menu).
return$items;
}
/**
* Constructs a descriptive page.
*
* Our menu maps this function to the path 'examples/page_example'.
*/
functionpage_example_description(){
returnarray('#markup'=>t('<p>The page_example provides two pages, "simple" and "arguments".</p><p>The <a href="@simple_link">simple page</a> just returns a renderable array for display.</p><p>The <a href="@arguments_link">arguments page</a> takes two arguments and displays them, as in @arguments_link</p>',array('@simple_link'=>url('examples/page_example/simple',array('absolute'=>TRUE)),'@arguments_link'=>url('examples/page_example/arguments/23/56',array('absolute'=>TRUE)))));
}
/**
* Constructs a simple page.
*
* The simple page callback, mapped to the path 'examples/page_example/simple'.
*
* Page callbacks return a renderable array with the content area of the page.
* The theme system will later render and surround the content in the
* appropriate blocks, navigation, and styling.
*
* If you do not want to use the theme system (for example for outputting an
* image or XML), you should print the content yourself and not return anything.
*/
functionpage_example_simple(){
returnarray('#markup'=>'<p>'.t('Simple page: The quick brown fox jumps over the lazy dog.').'</p>');
}
/**
* A more complex page callback that takes arguments.
*
* This callback is mapped to the path 'examples/page_example/arguments/%/%'.
*
* The % arguments are passed in from the page URL. In our hook_menu
* implementation we instructed the menu system to extract the last two
* parameters of the path and pass them to this function as arguments.
*
* This function also demonstrates a more complex render array in the returned
* values. Instead of just rendering the HTML with a theme('item_list'), the
* list is left unrendered, and a #theme attached to it so that it can be
* rendered as late as possible, giving more parts of the system a chance to