我将连接角色与灰尘模板ejs模板结合起来就像这种语法
<% if (userCan('impersonate')) { %>
<button id="impersonate">Impersonate</button>
<% } %>
Run Code Online (Sandbox Code Playgroud)
那是在玉
if userCan('impersonate')
button#impersonate Impersonate
Run Code Online (Sandbox Code Playgroud)
怎么在灰尘中这样做?
{@eq key=userCan('edit data') value="true" }
<td><a href='/assets/edit/{.ID_ASSET}'>Edit</a></td>
<td><a href='/assets/delete/{.ID_ASSET}'>Delete</a></td>
{:else}
{/eq}
Run Code Online (Sandbox Code Playgroud)
这段代码给我一个错误
Wed, 06 Jan 2016 16:57:47 GMT uncaughtException Expected end tag for assets but it was not found. At line : 42, column : 13
Run Code Online (Sandbox Code Playgroud)
编辑:我有这个 {@contextDump key="full"/}
"tail": {},
"isObject": true,
"head": {
"enrouten": {
"routes": {},
"path": "function path(name, data) {var route;route = this.routes[name];if (typeof route === 'string') {return path2regexp.compile(route)(data);}return …Run Code Online (Sandbox Code Playgroud)