Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“替换模式”这块很难读 #13

Open
freewind opened this issue Mar 16, 2013 · 3 comments
Open

“替换模式”这块很难读 #13

freewind opened this issue Mar 16, 2013 · 3 comments

Comments

@freewind
Copy link

Rythm为这种情况提供了一个名为“替换模式”的运行环境。这种方式可以完全避免由于运行不信任模版代码带来的担忧,因为该模式仅仅运行变量值替换,而所有可能带来不安全因素的特性都被屏蔽了,其中包括 表达式运算, 脚本 和 自由循环 等。运行“替换模式”的API是:

感觉像是机器翻译的。另外从这段描述中,没有看到哪儿有“替换”

@greenlaw110
Copy link
Collaborator

NND,真是年龄大了脑子也秀逗了,二十年前自认为还是文学青年的,现在说明文都不会写了。大概的意思就是在这句话:该模式仅仅运行变量值替换,你觉得怎么组织一下比较好?

@freewind
Copy link
Author

:)

还不太清楚什么样的代码会被替换,替换成什么,另外什么样的代码会原样显示不替换?

@greenlaw110
Copy link
Collaborator

只有变量替换啊,比如:

@action @object

中的actionobject可以被替换为:

hello world

但是替换模式不支持表达式,你不能说

@model.action @model.object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants