Documentation
¶
Index ¶
- Constants
- type AmberEngine
- func (s *AmberEngine) AddFunc(funcName string, funcBody interface{})
- func (s *AmberEngine) Binary(assetFn func(name string) ([]byte, error), namesFn func() []string) *AmberEngine
- func (s *AmberEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error
- func (s *AmberEngine) Ext() string
- func (s *AmberEngine) Load() error
- func (s *AmberEngine) Reload(developmentMode bool) *AmberEngine
- type DjangoEngine
- func (s *DjangoEngine) AddFilter(filterName string, filterBody FilterFunction) *DjangoEngine
- func (s *DjangoEngine) AddFunc(funcName string, funcBody interface{})
- func (s *DjangoEngine) Binary(assetFn func(name string) ([]byte, error), namesFn func() []string) *DjangoEngine
- func (s *DjangoEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error
- func (s *DjangoEngine) Ext() string
- func (s *DjangoEngine) Load() error
- func (s *DjangoEngine) RegisterFilter(filterName string, filterBody FilterFunction) *DjangoEngine
- func (s *DjangoEngine) RegisterTag(tagName string, parserFn TagParser) error
- func (s *DjangoEngine) Reload(developmentMode bool) *DjangoEngine
- type Engine
- type EngineFuncer
- type Error
- type FilterFunction
- type HTMLEngine
- func (s *HTMLEngine) AddFunc(funcName string, funcBody interface{})
- func (s *HTMLEngine) AddLayoutFunc(funcName string, funcBody interface{}) *HTMLEngine
- func (s *HTMLEngine) Binary(assetFn func(name string) ([]byte, error), namesFn func() []string) *HTMLEngine
- func (s *HTMLEngine) Delims(left, right string) *HTMLEngine
- func (s *HTMLEngine) ExecuteWriter(w io.Writer, name string, layout string, bindingData interface{}) error
- func (s *HTMLEngine) Ext() string
- func (s *HTMLEngine) Layout(layoutFile string) *HTMLEngine
- func (s *HTMLEngine) Load() error
- func (s *HTMLEngine) Option(opt ...string) *HTMLEngine
- func (s *HTMLEngine) Reload(developmentMode bool) *HTMLEngine
- type HandlebarsEngine
- func (s *HandlebarsEngine) AddFunc(funcName string, funcBody interface{})
- func (s *HandlebarsEngine) Binary(assetFn func(name string) ([]byte, error), namesFn func() []string) *HandlebarsEngine
- func (s *HandlebarsEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error
- func (s *HandlebarsEngine) Ext() string
- func (s *HandlebarsEngine) Layout(layoutFile string) *HandlebarsEngine
- func (s *HandlebarsEngine) Load() error
- func (s *HandlebarsEngine) Reload(developmentMode bool) *HandlebarsEngine
- type INodeTag
- type Parser
- type TagParser
- type Token
- type Value
- type View
Constants ¶
const NoLayout = "iris.nolayout"
NoLayout disables the configuration's layout for a specific execution.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmberEngine ¶
type AmberEngine struct {
// contains filtered or unexported fields
}
AmberEngine contains the amber view engine structure.
func Amber ¶
func Amber(directory, extension string) *AmberEngine
Amber creates and returns a new amber view engine.
func (*AmberEngine) AddFunc ¶
func (s *AmberEngine) AddFunc(funcName string, funcBody interface{})
AddFunc adds the function to the template's function map. It is legal to overwrite elements of the default actions: - url func(routeName string, args ...string) string - urlpath func(routeName string, args ...string) string - render func(fullPartialName string) (template.HTML, error).
func (*AmberEngine) Binary ¶
func (s *AmberEngine) Binary(assetFn func(name string) ([]byte, error), namesFn func() []string) *AmberEngine
Binary optionally, use it when template files are distributed inside the app executable (.go generated files).
The assetFn and namesFn can come from the go-bindata library.
func (*AmberEngine) ExecuteWriter ¶
func (s *AmberEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error
ExecuteWriter executes a template and writes its result to the w writer. layout here is useless.
func (*AmberEngine) Ext ¶
func (s *AmberEngine) Ext() string
Ext returns the file extension which this view engine is responsible to render.
func (*AmberEngine) Load ¶
func (s *AmberEngine) Load() error
Load parses the templates to the engine. It's alos responsible to add the necessary global functions.
Returns an error if something bad happens, user is responsible to catch it.
func (*AmberEngine) Reload ¶
func (s *AmberEngine) Reload(developmentMode bool) *AmberEngine
Reload if setted to true the templates are reloading on each render, use it when you're in development and you're boring of restarting the whole app when you edit a template file.
type DjangoEngine ¶
type DjangoEngine struct {
// contains filtered or unexported fields
}
DjangoEngine contains the amber view engine structure.
func Django ¶
func Django(directory, extension string) *DjangoEngine
Django creates and returns a new amber view engine.
func (*DjangoEngine) AddFilter ¶
func (s *DjangoEngine) AddFilter(filterName string, filterBody FilterFunction) *DjangoEngine
AddFilter registers a new filter. If there's already a filter with the same name, RegisterFilter will panic. You usually want to call this function in the filter's init() function: http://golang.org/doc/effective_go.html#init
Same as `RegisterFilter`.
func (*DjangoEngine) AddFunc ¶
func (s *DjangoEngine) AddFunc(funcName string, funcBody interface{})
AddFunc adds the function to the template's Globals. It is legal to overwrite elements of the default actions: - url func(routeName string, args ...string) string - urlpath func(routeName string, args ...string) string - render func(fullPartialName string) (template.HTML, error).