Documentation
¶
Overview ¶
Author: James Mallon <jamesmallondev@gmail.com> layout package -
Author: James Mallon <jamesmallondev@gmail.com> layout package -
Author: James Mallon <jamesmallondev@gmail.com> layout package - package offers functions to deal with templates and layouts
Author: James Mallon <jamesmallondev@gmail.com> layout package -
Index ¶
- Variables
- type FlashMessenger
- type FormValidator
- type LayoutManager
- type ViewFuncProvider
- func (this *ViewFuncProvider) Flash(msg ...interface{}) (flash template.HTML)
- func (this *ViewFuncProvider) FormatDate(t time.Time) string
- func (this *ViewFuncProvider) ToLower(text string) string
- func (this *ViewFuncProvider) ToUpper(text string) string
- func (this *ViewFuncProvider) UCFirst(text string) string
Constants ¶
This section is empty.
Variables ¶
var PageData map[string]interface{}
Functions ¶
This section is empty.
Types ¶
type FlashMessenger ¶
type FlashMessenger struct{}
Struct type flashMessenger -
func (*FlashMessenger) Get ¶
func (this *FlashMessenger) Get(w http.ResponseWriter, r *http.Request) (flshMsg *map[string]string)
Get method - it prints the message stored in the cookie
func (*FlashMessenger) Set ¶
func (this *FlashMessenger) Set(w *http.ResponseWriter, msg map[string]string)
Set function - it creates the cookie and set the flash message
type FormValidator ¶
Struct type FormHelper -
func (*FormValidator) ErrString ¶
func (this *FormValidator) ErrString(es []error) (emsg string)
CheckErrors method -
type LayoutManager ¶
type LayoutManager struct { ViewFuncProvider // contains filtered or unexported fields }
Struct type layoutHelper - offer DRY solutions to common controllers actions
func (*LayoutManager) Render ¶
func (this *LayoutManager) Render(w http.ResponseWriter, r *http.Request, pageData map[string]interface{}, views ...string)
Render method -
type ViewFuncProvider ¶
type ViewFuncProvider struct{}
Struct type ViewFuncProvider -
func (*ViewFuncProvider) Flash ¶
func (this *ViewFuncProvider) Flash(msg ...interface{}) (flash template.HTML)
Flash method - method receives a non obligatory param in form of a variadic to supress errors of layout requirements, converts the value into a map again and print the message accordingly with the website sample layout
func (*ViewFuncProvider) FormatDate ¶
func (this *ViewFuncProvider) FormatDate(t time.Time) string
FormatDate method - format a date
func (*ViewFuncProvider) ToLower ¶
func (this *ViewFuncProvider) ToLower(text string) string
ToLower method -
func (*ViewFuncProvider) ToUpper ¶
func (this *ViewFuncProvider) ToUpper(text string) string
ToUpper method -
func (*ViewFuncProvider) UCFirst ¶
func (this *ViewFuncProvider) UCFirst(text string) string
UCFirst method -