0

I am currently echoing some data from vue.js in laravel like so:

<a href="/beers/@{{ beer.id }}">
    <img src="@{{ beer.path }}" alt=""/>
</a>

It works but my console gives me the following error twice:

http://beerquest.dev/%7B%7B%20beer.path%20%7D%7D

Any other variables that I have printed out work fine because they are not within double quotes probably.

Funny enough everything seems to work fine though but I would like to get rid of the messy console messages. Does anybody know how to fix this?

3
  • What is the path of your image? and can I see your routes? Commented Oct 6, 2015 at 23:02
  • Well the actual path is: path: "/uploads/heineken.jpg" I found out the %7B means a brace so there is something wrong with the way I am using templating probably. Commented Oct 6, 2015 at 23:40
  • Can i see your routes? Commented Oct 6, 2015 at 23:43

1 Answer 1

3

Try without @ sign

<a href="/beers/{{ beer.id }}">
    <img src="{{ beer.path }}" alt=""/>
</a>

@ symbol will be removed by Blade; however, {{ name }} expression will remain untouched by the Blade engine, allowing it to instead be rendered by your JavaScript framework.

http://laravel.com/docs/5.1/blade#displaying-data

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.