mardi 19 février 2019

How to pass the value from controller to header file

I need to pass the data from the controller to a header file inside partials folder.

Suggest me how to pass the data "currency" from the controller to the header file.

Controller :

class HeaderController extends Controller
{
   public function rate(){
     $currency = Whmcs::GetCurrencies([         
     ]);
     return view('partials.header',compact('currency'));        
   }
}

Header file:

<form name="form">
    <select name="currency" class="form-control">
        @foreach($currency['currencies']['currency'] as $key=>$value)
           @for($key=0;$key<100;$key++)
           @endfor
           <option value=""></option>
        @endforeach
    </select>
</form>  

Route:

Route::any('/partials.header', 'HeaderController@rate');



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire