mardi 24 avril 2018

Passing back the variable from include blade in laravel

I am using laravel 5.3 and having some trouble getting back the variable from included blade. The problem is:

I have two blade:

1) main.blade.php 2) product.blade.php ( included in main.blade.php )

Now I am defining and calculating $fee in product.blade.php and the total is calculated in main.blade.php

I can see the $fee calculating properly in product blade. But when I add $fee to total, It shows me Undefined variable.

One solution is to define it global in main.blade.php and product.blade.php , But I dont want to use that approach.

Can someone help me with this please?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire