1
我有一个grails呈现标记,它呈现一小块HTML。有时,HTMl需要显示一些文本,有时候会显示一些文本和链接。将链接作为参数传递给g:在grails中呈现标记
这个代码块是工作的罚款:
<g:render template='accountInfo' model="[
'accountStatus':subscription.status,
'subscription':subscription.plan.name,
'msg':g.message (code: 'stripe.plan.info', args:'${[periodStatus, endDate]}')]"/>
但我希望能够在某些HTML以通为“味精”变量模型,这样对输出中的一些文字和链接:
<g:render template='accountInfo' model="[
'accountStatus':profile.profileState,
'subscription':'None selected yet',
'msg':<a href="${createLink(controller: 'charge', action: 'basicPlanList')}" title="Start your Subscription">Your profile is currently inactive, select a plan now to publish your profile.</a>]"/>
该代码不起作用。我尝试添加的链接标签库,但我无法弄清楚如何的taglib传递给“味精”之一:
<g:render template='accountInfo' model="[
'accountStatus':profile.profileState,
'subscription':'None selected yet',
'msg':<abc:showThatLink/>]"/>
我愿意接受建议,就如何更好地实现传递文本只有文本和grails createLink封闭以及链接的一些文本。
#2工作,但我不得不删除封闭的味精让它运行:'味精':myMsg – spock99