{{url_for(arg1,arg2)}}的动态与静态使用
url_for(endpoint, **values):
用法
1.为动态路由传参
eg: <td><a target="_blank" href="{{ url_for("front.post_detail",post_id=post.id) }}">{{ post.title }}</a></td>
source:
@bp.route('/p/<post_id>/')
def post_detail(post_id):
post = P
原创
2021-06-25 10:35:26 ·
412 阅读 ·
0 评论