Skip to content

Commit

Permalink
change html template extention to .tpl from .html
Browse files Browse the repository at this point in the history
  • Loading branch information
vnxx committed Jul 14, 2024
1 parent 139dfc2 commit aae6c9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func New(c Config) (*fiber.App, router.RouterInterface, support.Refiber) {
AppName: config.AppName,
}

engine := html.New("./resources/views", ".html")
engine := html.New("./resources/views", ".tpl")
engine.AddFunc(
"raw", func(s string) template.HTML {
return template.HTML(s)
Expand Down
2 changes: 2 additions & 0 deletions support/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/go-playground/validator/v10"
"github.com/gofiber/fiber/v2"

"github.com/refiber/framework/constant"
)

Expand All @@ -18,6 +19,7 @@ func (s *support) Validate(sct interface{}) error {

m := make(fiber.Map, len(err.(validator.ValidationErrors)))
for _, err := range err.(validator.ValidationErrors) {
// use lower case?
m[strings.ToLower(err.Field())] = err.Translate(*s.translator)
}

Expand Down

0 comments on commit aae6c9b

Please sign in to comment.