mercredi 27 septembre 2017

What would be the consequences of passing all variables from controller to view?

What could go wrong if I always pass all variables to the view like this?

public function index(){
    $var1= '1';
    $var2= '2';
    $var3= '3';
    $var4= '4';
    $var5= '5';
    $var6= '6';

    return view('index',compact(array_keys(get_defined_vars())));
}



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

Aucun commentaire:

Enregistrer un commentaire