HAML-什么是“!="接线员呢? [英] HAML - what does the "!=" operator do?

查看:74
本文介绍了HAML-什么是“!="接线员呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在看一些看似标准的Haml代码,但只是注意到它以!="开头,并且经过5分钟的谷歌搜索未能为我提供有关其功能的答案:

I am looking at some seemlingly standard Haml code right now, but just noticed it starts off with a "!=", and 5 minutes of googling has failed to give me the answer for what it does:

#What does the '!=' mean? 
!= cache_content_if_not_prefetched(params) do
  -if product_live?
    =render :partial => 'products/product_tile'
  -else
    =render :partial => 'products/unavailable_product_tile'

推荐答案

与使用=相同,但不清除HTML

Same as using = but doesn't sanitize the HTML

请参见 http://haml.info/docs/yardoc/file.REFERENCE .html#unescaping_html

!= "Look  <up>!"

编译为

Look <up>!

代替

Look &ltg;up&gt;

这篇关于HAML-什么是“!="接线员呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆