Tuesday, February 15, 2011

Drupal Menu

This is important case. When you write a drupal hook of menu, plase keep in mind for include your package to the first segment of uri.
package = learning
module = lola
function lola_menu(){
    $items = array();
    $items['learning/lola'] = array(
        'title' => 'Lola Main Menu',
        'page callback' => 'hello',
        'access callback' => TRUE,
    return $items;

function hello(){
    // echo 'Hello For You All';
    // if you want the echo of text written as a part of page,
    // use below
    return t('Hello For You All');

No comments:

Post a Comment