1
votes

I'm getting the error:

Use of undefined constant image - assumed 'image' (View: C:\laragon\www\project\resources\views\home.blade.php)

When I try to display my Algolia hit template which is:

<script type="text/html" id="hit-template">
<div class="hit">
<div class="hit-image">
  <img src="{{image}}" alt="{{name}}">
</div>
<div class="hit-content">
  <h3 class="hit-price">${{price}}</h3>
  <h2 class="hit-name">{{{_highlightResult.name.value}}}</h2>
  <p class="hit-description">{{{_highlightResult.description.value}}}</p>
</div>
</div>
</script>

But it looks like Laravel thinks I'm trying to output info with Blade. Is there any way around this?

1

1 Answers

3
votes

You're correct about the fact that blade considers curly braces as being part of its template.

It seems like you can use this syntax to tell blade to not try to interpolate:

@{{ ... }}

and

@{{{ ... }}}

Source: Blade engine: print triple curly braces .