【发布时间】:2014-07-10 10:15:39
【问题描述】:
我在 nodejs 的后端使用 ejs。 我想在包含时传递变量。包含标题时,传递页面标题。
index.ejs:
<% include header %>
<body> . . . </body>
<% include footer%>
header.ejs:
<html lang="en">
<head>
<title><%- my_tytle %></title>
</head>
页脚.ejs:
</html>
如何在include命令中传递my_title?
【问题讨论】:
-
我认为当
my_title在 index.ejs 中定义时,它在 header-partial 中也是已知的 ... -
你能举个例子吗?
标签: ejs