有办法从字符串中获取值吗?
例如:
"SomeString" has the value "Edward".输入:
{% assign variable = 'SomeString' %}
{{ variable }}输出:
SomeString注意事项:SomeString是在运行时构造的字符串,因此实际上我需要从字符串中获取值->我不能删除赋值中的引号。
发布于 2017-06-20 18:11:38
DotLiquid中没有任何东西允许这样做,但是始终可以在运行时创建自己的Tag或构建模板。
public sealed class RuntimeAssign : Tag
{
...
}
Template.RegisterTag<RuntimeAssign>("runtimeassign");https://stackoverflow.com/questions/43117734
复制相似问题