Hi,
ich steh momentan echt aufm Schlauch. Ich hab eine Funktion geschrieben, die sich beharrlich weigert, einen Rückgabewert auszugeben.
function pathway($id = ''){
global $pathway_array, $pathway_actpage;
if($id == ""){
$act_ = $GLOBALS['db']->read(TB_PAGES, "parent, menu_text", "id='" . get('id') . "'");
$id = $act_['parent'];
$pathway_actpage = array('id' => $id, 'menu_text' => $act_['menu_text']);
}
$act = $GLOBALS['db']->read(TB_PAGES, "parent, menu_text", "id='" . $id . "'");
$pathway_array[] = array('id' => $id, 'menu_text' => $act['menu_text']);
if($act['parent'] != "1")
pathway($act['parent']);
else{
$pathway_array = array_reverse($pathway_array);
$pathway = $GLOBALS['user']->get_username($GLOBALS['my']->id()) . " :: ";
foreach($pathway_array as $pathway_page){
$pathway .= '<a href="" class="pathway_pages">' . $pathway_page['menu_text'] . '</a> > ';
}
$pathway .= '<span class="pathway_act_page">' . $pathway_actpage['menu_text'] . '</span>';
echo $pathway;
return $pathway;
}
}
Jetzt wird zwar der String mit echo $pathway; ausgegeben, das return $pathway ist aber wirkungslos.
Der Aufruf erfolgt per
echo pathway();
Ich hab echt keine Ahnung mehr, woran es liegen kann. Sieht vielleicht jemand einen Fehler? Eine andere Funktion in der gleichen Datei macht keine Probleme. Ich hab auch nichts gefunden, das "pathway" ein reserviertes Wort ist, und auch eine änderung des Funktionsnamens brachte nix :(