mercredi 2 mai 2018

Blade - Print variable into variable

I am trying to print a variable into another variable in a blade template. I have a variable from database that contains "dynamic" data from another variable.

Example:

$foo = 'user';
$bar = 'Hello , how are you?';

In blade I am doing this:

{!! $bar !!}

But the result is:

Hello , how are you?

I tried with but the result is the same.

I can't concatenate both variables. For example:

$foo = 'user';
$bar = 'Hello ' . $foo . ', how are you?';

It isn't possible because I don't have the control of the variables, they are filled dynamically from database.

Any idea/suggestion?

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire