render

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2017 License: Apache-2.0 Imports: 6 Imported by: 33

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDataKey       = `data`
	DefaultTmplKey       = `tmpl`
	DefaultTmplName      = `index`
	DefaultErrorTmpl     = `error`
	JSONPCallbackName    = `callback`
	DefaultErrorFunc     = OutputError
	DefaultOutputFunc    = Output
	DefaultErrorHTTPCode = http.StatusInternalServerError
)

Functions

func AutoOutput

func AutoOutput(outputFunc func(string, echo.Context) error, skipper ...echo.Skipper) echo.MiddlewareFunc

AutoOutput Outputs the specified format

func Del

func Del(key string)

func HTTPErrorHandler added in v1.1.0

func HTTPErrorHandler(templates map[int]string, formatRender ...func(string, echo.Context) error) echo.HTTPErrorHandler

func Middleware

func Middleware(d echo.Renderer) echo.MiddlewareFunc

Middleware set renderer

func New

func New(key string, tmplDir string, args ...logger.Logger) Driver

func Output

func Output(format string, c echo.Context) error

Output Outputs the specified format

func OutputError

func OutputError(err error, format string, c echo.Context) error

OutputError Outputs the specified format

func Reg

func Reg(key string, val func(string) Driver)

func SetFuncs

func SetFuncs(c echo.Context, v *echo.Data)

SetFuncs register template function

Types

type Config added in v1.1.0

type Config struct {
	Theme        string
	Engine       string
	Style        string
	Reload       bool
	ParseStrings map[string]string
}

func (*Config) Parser added in v1.1.0

func (t *Config) Parser() func([]byte) []byte

Directories

Path Synopsis
sse
* * 模板扩展 * @author swh <swh@admpub.com>
* * 模板扩展 * @author swh <swh@admpub.com>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL