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