Django Book 翻译
菜单>:
TOC
返回
原文:
* You may not define multiple ``{% block %}`` tags with the same name in the same template. This limitation exists because a block tag works in both directions. That is, a block tag doesnt just provide a hole to fill, it also defines the content that fills the hole in the *parent* . If there were two similarly named ``{% block %}`` tags in a template, that templates parent wouldnt know which one of the blocks content to use.
翻译:
* 不可同一个模板中定义多个同名的 ``{% block %}`` 。存在这样的限制是因为block 标签的工作方式是双向的。也就是说,block 标签不仅挖了一个要填的坑,也定义了在 *父* 模板中这个坑所填充的内容。如果模板中出现了两个相同名称的 ``{% block %}`` 标签,父模板将无从得知要使用哪个块的内容。
备注:
译者: