So my dilemna is this.

<p>Email: info@example.com</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

有帮助吗?

解决方案 2

The following will avoid blade syntax:

<p>Email: info<?php echo urldecode('%40')?> example.com</p>


%40 is equivalent to @

其他提示

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.

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('myemail@mail.com','Some person'); }}

// Generates :
<a href="mailto:myemail@mail.com">Some person</a>

View more of these helpers at http://www.laravel-tricks.com/tricks/generating-html-using-html-methods

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top