2
drupalでhook_menuを実装しようとしました。私はdrupalの定義されていないオフセットエラーです。
'access callback' => TRUE,
に
'access callback' => 'user_access',
を変更した場合
Notice: Undefined offset: 0 in _menu_check_access() (line 619 of /Applications/XAMPP/xamppfiles/htdocs/drupal/includes/menu.inc).
Notice: Undefined offset: 1 in _menu_check_access() (line 619 of /Applications/XAMPP/xamppfiles/htdocs/drupal/includes/menu.inc).
上記2つのエラーが表示されません。
function menufun_menu() {
$items['menufun'] = array(
'title' => 'Menu Fun',
'title callback' => 'menufun_title',
'page callback' => 'menufun_greeting',
'file' => 'menufun_greeting.inc',
'page arguments' => array('aaa', 'bbb', 'ccc', 'ddd'),
'access callback' => 'user_access',
'access arguments' => array('receive greeting'),
'type' => MENU_NORMAL_ITEM,
'weight' => -1,
);
$items['menufun/farewell'] = array(
'title' => 'Farewell',
'page callback' => 'menufun_farewell',
'file' => 'menufun_greeting.inc',
'access callback' => 'user_access',
'access agruments' => array('receive greeting'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
しかし、上記のコードは、これらの2つのエラーケースます
しかし、私はすでに管理者としてログインしていますrと私はすべてのユーザーにアクセス許可を与え、モジュールをリロードしようとしましたが、drupalを再インストールしてデータベースをきれいにするようにしましたが、同じエラー、アドバイスがありますか?
ああ...わかります。それは動作します、ありがとう! – qkzhu
喜んで助けてください!彼らがあなたの問題を解決したものであることを将来の人々が知っているので、彼らが働くならば、答えを受け入れたものとしてマークすることを忘れないでください – jprofitt
わかりました、説明のおかげで:) – qkzhu