jeudi 2 septembre 2021

Access php variable defined in master blade in other blades where master blade is extended . PHP Laravel

I am working on a laravel php project and I have a global blade where I have defined a variable

<?php
    $a = "some value fetched dynamically";
?>

And i am extending this blade in over 100 blade files like this

@extends('global')

In all these blades how can I access this $a variable?

Versions - PHP 7.2.34, Laravel 5.3.31

Thanks in advance.

PS: if there is any other way where i can get the php variable/function defined in global blade in other blades please feel free to suggest.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire