2014-01-10 42 views
0

我有一个Drupal菜单,其页面回调是best_quote,文件是handle.php.inc。 handle.php.inc的内容是:drupal 7菜单返回全局结果

<?php 

function best_quote(){ 
$token=get_token('RT1IADDOH2014-01-20T00:00:00DOHIAD2014-03-05T00:00:00NAENNN100QR0000USD'); 
get_search_results($token); 
$results=get_search_results($token); 
return $results; 
} 



function get_token($entry){ 
    $client = new SoapClient(); 
    $result=$client->do_LowfareSearch(array('rq'=>$array));// return the token 
    $token= $result->do_LowfareSearchResult; 
    return $token; 

} 
function get_search_results($token){ 
    $client = new SoapClient(); 
    $polling_array=array(); 
    $polling_array['rid']=$token; 
    $response= $client->do_Polling($polling_array); 
    $results= $response->do_PollingResult; 
    $xml = simplexml_load_string($results); 
    $json = json_encode($xml); 
    $array = json_decode($json,TRUE); 
      $search_results_first_part=$array["PricedItineraries"]['PricedItinerary']; 
    $priced_itineraries_count= count($search_results_first_part); 
    if($priced_itineraries_count==0){ 
     get_search_results($token); 
    }else if($priced_itineraries_count==4){ 
     get_search_results($token); 
    }else { 
    return $xml; 

} 

} 

在best_quotes()函数中,我想返回结果,但页面是空白的。你知道什么是错的吗?谢谢。

回答

0

我发现问题:在if条件中,我们必须返回get_search_results($ token);什么时候没有回报。