0
다음과 같은 base.html
파일이 있습니다.이 파일은 상속하는 다른 모든 파일의 주 골격 역할을합니다. HTML 파일이 lookup.get_template('foo.html')
와 파이썬 파일에서 호출됩니다상속 된 파일의 액세스 특성
<%inherit file="base.html" />
Whatever... ${anotherAttribute}
:
<%! import cherrypy %>
<!DOCTYPE html>
<html>
<body>
<div class="container">
<% attribute='defaultValue' %>
${attribute}
<p>
${self.body()}
</p>
</div>
</body>
</html>
는 지금은 이름을에게 foo.html
을 할 수는 base.html
상속 다른 파일이 있습니다.
anotherAttribute
에 lookup.get_template('foo.html').render(anotherAttribute='bar')
으로 액세스 할 수 있습니다. 이제 attribute
에 base.html
에 액세스하는 방법이 궁금합니다.