Same name and namespace in other branches
  1. 7.x-1.x page_example/page_example.module \page_example_description()

None of these page examples makes use of the Form API. The Form Example provides examples that do.

Related topics

1 string reference to 'page_example_description'
page_example_menu in page_example/page_example.module
Implementation of hook_menu().

File

page_example/page_example.module, line 173
This is an example outlining how a module can be used to display a custom page at a given URL.

Code

function page_example_description() {
  $output = '<p>';
  $output .= t('The page_example provides four pages, "simple", "arguments",
    "different permissions" and "custom access callback".');
  $output .= '</p>';
  $output .= '<p>';
  $output .= t('The <a href="@simple_link">simple page</a>,
    <a href="@dp_link">different permissions page</a> and
    <a href="@cac_link">custom access callback page</a>
    just return a string for display.
    The <a href="@arguments_link">arguments page</a> takes
    two arguments and displays them,
    as in <a href="@arguments_link">@arguments_link</a>.', array(
    '@simple_link' => url('examples/page_example/simple', array(
      'absolute' => TRUE,
    )),
    '@dp_link' => url('examples/page_example/different-permission', array(
      'absolute' => TRUE,
    )),
    '@cac_link' => url('examples/page_example/custom-access-callback', array(
      'absolute' => TRUE,
    )),
    '@arguments_link' => url('examples/page_example/arguments/23/56', array(
      'absolute' => TRUE,
    )),
  ));
  $output .= '</p>';
  $output .= '<p>';
  $output .= t('Note also that because these pages use permissions to
    limit access to the content, unprivileged or anonymous users
    will receive \'Access Denied\' errors.');
  $output .= '</p>';
  return $output;
}