SaidbakR
SaidbakR

Reputation: 13534

Laravel blade and @ escape as a text

I have two variables that I want print them in Laravel blade template as a text with @ sign. Suppose the following: $var1 = 1500 $var2 = 50.51

So I want print them to be Production is: [email protected]% I have tried: Production is: {{$var1}}@{{$var2}}%

The above code generates:

Production is: 1500{{$var2}}%

I could not able to find any escape for @ other than printing it as a string like the following:

Production is: {{$var1}}{{'@'}}{{$var2}}% So, is there any way to escape @ in blade template?

Upvotes: 3

Views: 1081

Answers (1)

Vincent Decaux
Vincent Decaux

Reputation: 10714

Just use :

Production is: {{ $var1 .'@'. $var2 }}%

Simplest way to do what you want.

Upvotes: 5

Related Questions