github.com/segakazzz/buffalo@v0.16.22-0.20210119082501-1f52048d3feb/render/plain.go (about)

     1  package render
     2  
     3  // Plain renders the named files using the 'text/html'
     4  // content type and the github.com/gobuffalo/plush
     5  // package for templating. If more than 1 file is provided
     6  // the second file will be considered a "layout" file
     7  // and the first file will be the "content" file which will
     8  // be placed into the "layout" using "<%= yield %>".
     9  func Plain(names ...string) Renderer {
    10  	e := New(Options{})
    11  	return e.Plain(names...)
    12  }
    13  
    14  // Plain renders the named files using the 'text/plain'
    15  // content type and the github.com/gobuffalo/plush
    16  // package for templating. If more than 1 file is provided
    17  // the second file will be considered a "layout" file
    18  // and the first file will be the "content" file which will
    19  // be placed into the "layout" using "<%= yield %>".
    20  func (e *Engine) Plain(names ...string) Renderer {
    21  	hr := &templateRenderer{
    22  		Engine:      e,
    23  		contentType: "text/plain; charset=utf-8",
    24  		names:       names,
    25  	}
    26  	return hr
    27  }