Reputation: 105
So my dilemna is this.
<p>Email: [email protected]</p>
Is being processed as blade code and won't re-size in my responsive bootstrap web page in my Laravel 4 framework.
Any ideas on how to get blade to ignore the @ symbol? It is probably a simple fix I just can't find it on the web.
Thanks
Upvotes: 3
Views: 3286
Reputation: 5942
A really simple way would be this:
someone{{'@'}}email.com
{{ $whatever }}
effectively gets transformed into <?= e($whatever) ?>
(where e()
does HTML escaping) so you can put a string there, and that will get output instead of a variable.
Upvotes: 9
Reputation: 524
There are also HTML helpers in Laravel, you can use the following to generate a mailto tag with an obfuscated email address:
# Generating obsufscated mailto tag
{{ HTML::mailto('[email protected]','Some person'); }}
// Generates :
<a href="mailto:[email protected]">Some person</a>
View more of these helpers at http://www.laravel-tricks.com/tricks/generating-html-using-html-methods
Upvotes: 3
Reputation: 12169
The following will avoid blade syntax:
<p>Email: info<?php echo urldecode('%40')?> example.com</p>
%40 is equivalent to @
Upvotes: 4