启动上一篇运行的代码,文件macro_test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% macro input() %}
<input type="text" value="" size="30">
{% endmacro %}
<h1>input 1</h1>
{{ input() }}
<h1>input 2</h1>
{{ input() }}
<hr/>
{% macro input2(type,value,size) %}
<input type="{{ type }}" value="{{ value }}" size="{{ size }}">
{% endmacro %}
<h1>input 2</h1>
{{ input2("password","",50) }}
</body>
</html>
网友评论