7

I am using Laravel 4 with the Blade Templating Engine and Hogan.js.

By default my site thinks {{...}} is used by PHP and Laravel. Now I want to use Hogan.js and the syntax is {{...}} too. I am getting an error, because they use the same syntax here.

How can I use both?

totymedli
  • 29,531
  • 22
  • 131
  • 165
zer02
  • 3,963
  • 4
  • 31
  • 66

1 Answers1

16

You can prepend @ to your Hogan placeholders, and Laravel will ignore them.

// This will work only in JavaScript
@{{ JavaScript }}

// This will be rendered in blade
{{ $foo }}
Manuel Pedrera
  • 5,347
  • 2
  • 30
  • 47