我想定义自己的标记库,它将使用 g:datePicker
生成一些输出。
class MyTagLib
def myTag = {attrs ->
// I need to invoke the `datePicker` tag of the the `FormTagLib` tag library
// provided by Grails
}
}
我想在调用此标记时传递属性映射。当我调用 g:datePicker
时,我希望它将输出直接写入响应(就像在 GSP 中调用它时一样)。
我该怎么做? 谢谢。
最佳答案
out << g.datePicker(etc...)
应该这样做。其他标记库前缀会自动进行元编程。
关于Grails:从另一个标签库中调用一个标签库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2215476/