| 6 page_example.module | page_example_simple() |
| 7 page_example.module | page_example_simple() |
| 8 page_example.module | page_example_simple() |
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.
Related topics
1 string reference to 'page_example_simple'
File
- page_example/
page_example.module, line 160 - Module file for page_example_module.
Code
function page_example_simple() {
return array('#markup' => '<p>' . t('Simple page: The quick brown fox jumps over the lazy dog.') . '</p>');
}
Login or register to post comments
Comments
how to add textfield to page() function
Hi all,
function _current_posts_page() {
drupal_set_title('Current posts');
$result = current_posts_contents('page');
//Array to contain items for the page to render.
$items = array();
//Iterate over the resultset and format as links.
$header = array(
// creating array that contains data from first cell
array('data' => t('Name')),
// second cell
array('data' => t('Email Id')),
// and third cell
array('data' => t('Phone no ')),
array('data' => t('Delete link '))
);
$val=1;
if(empty($result))
$val=0;
foreach ($result as $node)
{
$rows_table_edit[] =
array(
array('data'=>l($node->title,'node/'. $node->nid)),array('data'=>$node->_email_value),array('data'=>$node->_phone_no_value), array(
// path to node deletion
'data' => l(t('MORE ..'),'node/' .$node-> nid ) ) );
}
// table caption
$caption_table_edit = t('Table for Address book list nodes.');
// in this variable we'll se a function that will
$table_edit = theme('table', array('header' => $header,
'rows' => $rows_table_edit,
'caption' => $caption_table_edit
)
);
// return table with edit links first($table_edit),
// then output table with delete links ($table_delete).
if (empty($rows_table_edit)&&$val==0) { //No content in the last week.
$page_array['current_posts_arguments'] = array(
//Title serves as page subtitle
'#title' => t('All posts from the last week'),
'#markup' => t('No posts available.'),
);
return $page_array;
}
else {
return $table_edit;
}
}
this is my code for page function.
here i am displaying table listing all node record of type address book. actually i want to create one filter(textbox).how i can do this???