Support the ongoing development of Laravel.io →
posted 10 years ago
Blade
Last updated 2 years ago.
0

What if you do this:

<a href="https://www.google.com/maps/@{{ e($myvar->lat) }},{{ e($myvar->lng) }}" target="_blank">View Full Size Map</a>

I'm not sure if the e() is in this laravel version.

Edit: It used to be in Laravel 3, but can't find anything in the Laravel 4 docs. Laravel 3 docs link: http://three.laravel.com/docs/views/html#entities

Last updated 2 years ago.
0

Thanks for your response but unfortunately that doesn't work :) The '@' symbol escapes the curly braces so that you would actually see the braces and inner content in the browser - in the case that you wanted to actually display text that contained those curly braces.

It's just unfortunate that Google in their wisdom, decided to use the '@' symbol within their urls.

No problem, it's an easy workaround but would be nice to see a way of preventing that behaviour when necessary, without resorting to '<?php' in a blade template.

Last updated 2 years ago.
0

why don't you just do {{ '@' . $myvar->lat }}

Last updated 2 years ago.
0

Doh, how dumb of me, of course! Thanks dberry :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

sitesense sitesense Joined 30 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.