vendredi 11 mai 2018

Getting error as stated below while passing three array values from controller to the view(i.e., to the same page)

Find below the controller code:

    public function domaincheck()
{

    $response = file_get_contents('https://resellertest.enom.com/interface.asp?command=check&sld=unusualTVname&tld=tv&uid=resellid&pw=resellpw&responsetype=xml');  
        $data = simplexml_load_string($response);
        $configdata   = json_encode($data);
        $final_data = json_decode($configdata,true);// Use true to get data in array rather than object
        // dd($final_data);



        $response1 = file_get_contents('http://resellertest.enom.com/interface.asp?command=GETNAMESUGGESTIONS&UID=resellid&PW=resellpw&SearchTerm=hand&MaxResults=5&ResponseType=XML');       
        $data1 = simplexml_load_string($response1);
        $configdata1   = json_encode($data1);
        $final_data1 = json_decode($configdata1,true);// Use true to get data in array rather than object
        //dd($final_data1);


        $response2 = file_get_contents('https://resellertest.enom.com/interface.asp?command=gettldlist&UID=resellid&PW=resellpw&responsetype=xml');  
        $data2 = simplexml_load_string($response2);
        $configdata2   = json_encode($data2);
        $final_data2 = json_decode($configdata2,true);
        //dd($final_data2);


       return view('clientlayout.main.test',array('final_data1' => 
       $final_data1), array('final_data' => $final_data), 
       array('final_data2' => $final_data2));

}

Find the view code given below:



<br><br><br>


<br> 



Find the route code given below:

Route::get('/test','EnomController@domaincheck');

I need to return all the three arrays to the view page but When use the return view code giveb above I'm getting error as "Undefined variable: final_data2 " for the third array alone.If I declare only two array statements in the return view it works correctly. Suggest me a solution to solve this error.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2wCV7qq
via IFTTT

Aucun commentaire:

Enregistrer un commentaire