6
보기가있는 경우보기 파일의 < 머리 >에 정적 파일 (CSS 및 JS)을 어떻게로드 할 수 있습니까?web2py의보기 HTML에서 정적 파일을로드하는 방법은 무엇입니까?
layout.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{=T.accepted_language or 'en'}}">
<head>
<title>{{=response.title or request.application}}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- include requires CSS files
{{response.files.append(URL(request.application,'static','base.css'))}}
{{response.files.append(URL(request.application,'static','ez-plug-min.css'))}}
-->
{{include 'web2py_ajax.html'}}
</head>
<body>
{{include}}
</body>
</html>
위의 예에서 myview.html
{{extend 'layout.html'}}
{{response.files.append(URL(r=request,c='static',f='myview.css'))}}
<h1>Some header</h1>
<div>
some content
</div>
은 "myview.css"파일 web2py 무시하거나하여 벗겨 어느 브라우저.
그래서이 CSS 파일과 같은 페이지 별 파일을로드하는 가장 좋은 방법은 무엇입니까? 차라리 레이아웃에 모든 정적 파일을 채우지 않을 것입니다.
Perfect. 감사! – MikeWyatt