1
在GSP中,我想通過agrs
鏈接<g:message code='myCode' args='link'>
,我試過args="${createLink(controller:'myCon',action:'myAc')}"
,但這不起作用。Grails:如何在消息的參數中傳遞鏈接
任何想法?
在GSP中,我想通過agrs
鏈接<g:message code='myCode' args='link'>
,我試過args="${createLink(controller:'myCon',action:'myAc')}"
,但這不起作用。Grails:如何在消息的參數中傳遞鏈接
任何想法?
應該很容易與您的messages.properties
文件
my.message.key=Just a link to <a href="{0}">Something</a>
以下,然後調用它像這樣:
<g:message code="my.message.key" args="[createLink(controller: 'foo', action: 'baz')]" />
請記住,對於消息代碼參數是一個數組,因此上面使用了括號。
謝謝工作,我以爲我不能在'messages.properties'中寫'' – Sherif