{% f2 1 2 3 4 %} 在HTML中定义
在py文件中定义:
@register.simple_tag
def f2(s1,s2,s3,s4):
return s1+s2+s3+s4
共同点:
都可以创造方法
传参数有限制,对于sample_tag传参数没有限制
{% f2 1 2 3 4 %} 在HTML中定义
在py文件中定义:
@register.simple_tag
def f2(s1,s2,s3,s4):
return s1+s2+s3+s4
共同点:
都可以创造方法
传参数有限制,对于sample_tag传参数没有限制