Laravel 4 Blade {{}} and Hogan.js {{}} Syntax

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

By default, my site considers that {{...}} used by PHP and Laravel. Now I want to use Hogan.js, and the syntax is {{...}} . I get an error because the same syntax is used here.

How can i use both?

+7
javascript php laravel laravel-4
source share
1 answer

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

 // This will work only in JavaScript @{{ JavaScript }} // This will be rendered in blade {{ $foo }} 
+16
source share

All Articles