Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在控制器中呈现Grails标记_Grails_Controller_Gsp - Fatal编程技术网

在控制器中呈现Grails标记

在控制器中呈现Grails标记,grails,controller,gsp,Grails,Controller,Gsp,我必须在调用控制器函数时呈现select class FormController { def document() { render """<g:select name="tipo" from="${['','one','two']}" />""" } } 类窗体控制器{ def文档(){ 渲染“” } } 它不起作用。。当我用此函数替换div时,html中不会显示任何内容。请使用以下语法: class FormController {

我必须在调用控制器函数时呈现select

class FormController {
    def document() {
        render """<g:select name="tipo" from="${['','one','two']}" />"""
    }
}
类窗体控制器{
def文档(){
渲染“”
}
}
它不起作用。。当我用此函数替换div时,html中不会显示任何内容。

请使用以下语法:

class FormController {
    def document() {
        render """<g:select name="tipo" from="${['','one','two']}" />"""
    }
}
render g.select(name:"tipo" from:['','one','two'])
谢谢:
render(文本:g.select(名称:“tipo”from:['','one','two'))