简体   繁体   English

Laravel 4 Blade {{}}和Hogan.js {{}}语法

[英]Laravel 4 Blade {{}} and Hogan.js {{}} Syntax

I am using Laravel 4 with the Blade Templating Engine and Hogan.js. 我正在使用Laravel 4和Blade Templating Engine以及Hogan.js。

By default my site thinks {{...}} is used by PHP and Laravel. 默认情况下,我的网站认为PHP和Laravel使用{{...}} Now I want to use Hogan.js and the syntax is {{...}} too. 现在我想使用Hogan.js,语法也是{{...}} I am getting an error, because they use the same syntax here. 我收到一个错误,因为他们在这里使用相同的语法。

How can I use both? 我怎么能同时使用?

You can prepend @ to your Hogan placeholders, and Laravel will ignore them. 您可以将@到您的Hogan占位符,Laravel将忽略它们。

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

// This will be rendered in blade
{{ $foo }}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM