2013-01-18 7 views
0

로그인 한 사용자에 따라 동적으로 변경되는 메뉴 항목을 만들려고합니다. 내가 잘못 뭘하는지 아무 생각메뉴 항목이 표시되지 않는 이유는 무엇입니까?

<?php 
global $user; 
$current_uid = $user->uid; 
$current_name - $user->name; 
function willmodule_menu(){ 
$techprofile = 'tech=profile/' . $current_uid . '/' . $current_name; 
$items['$techprofile'] = array(
    'menu_name' => 'menu-tech-account-menu', 
    'title'=>'View Your Tech Profile', 
); 
return $items; 
} 
?> 

:

여기 내 모듈의 코드입니다. 내 메뉴 항목이 표시되지 않습니다. 더하기 측면에서, 그것은 내 사이트를 깨고 아니지만.

답변

0

음 코드에서 몇 가지 중 하나 오타 게시하는 동안 또는 실제 실수 있습니다 :

1. $current_name - $user->name; //change dash to = sign? 
    2. $items['$techprofile'] //use double quotes instead of single quotes when 
          //using php variables 
+0

그것은 내가 전에 인해 단순 오타로 헤어 당겨 좌절 했어 사실이지만 심지어이 두 도움이되지 않았다 주소 나 밖으로. – willrichir

관련 문제