函数错误缺少参数1

时间:2022-01-29 02:24:48

Warning: Missing argument 1 for function abc()

警告:函数abc()缺少参数1

 function ort_view_menu() { 
      $items['thick_box_view'] = array( 
        'title' => 'Viewed Details', 
        'description' => 'g a report', 
        'page callback' => 'abc', 
        'type' => MENU_CALLBACK, 
        'access callback' => TRUE, 
       ); 

return $items;
}
         function abc($nid) { 
         $rows = array();
    $node = node_load($nid); 

Is the error caused due to $nid used in the function ?

这个错误是由于函数中使用了$nid引起的吗?

2 个解决方案

#1


-1  

Yes, The call to the function abc does not supply the required argument $nid needed in the function.

是的,对函数abc的调用不提供函数中需要的$nid参数。

#2


2  

If you don't always need this parameter you could change it like this

如果你不总是需要这个参数,你可以像这样改变它

function abc($nid=''){
 ...
}

#1


-1  

Yes, The call to the function abc does not supply the required argument $nid needed in the function.

是的,对函数abc的调用不提供函数中需要的$nid参数。

#2


2  

If you don't always need this parameter you could change it like this

如果你不总是需要这个参数,你可以像这样改变它

function abc($nid=''){
 ...
}