Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultCacheBuster = random.String(10)
)
Functions ¶
Types ¶
type BaseContext ¶
type BaseContext interface {
// IsAuth returns whether the user is authenticated
IsAuth() bool
GetAuthUser() *ent.User
// GetPath returns the current request path
GetPath() string
// GetCSRF returns the CSRF token for the current request
GetCSRF() string
}
BaseContext defines the minimum interface required by all templates
type FuncMap ¶
type FuncMap struct {
// contains filtered or unexported fields
}
func NewFuncMap ¶
NewFuncMap provides a template function map
type PageContext ¶
type PageContext interface {
BaseContext
// GetTitle returns the page title
GetTitle() string
// GetAppName returns the application name
GetAppName() string
// GetMessages gets all flash messages for a given type
GetMessages(typ msg.Type) []template.HTML
// GetHTMXRequest returns the HTMX request information
GetHTMXRequest() any
// GetData returns the page-specific data
GetData() any
GetPager() page.Pager
URL(routeName string, params ...any) templ.SafeURL
File(file string) templ.SafeURL
Link(url, text, currentPath string, classes ...string) templ.Component
}
PageContext defines the interface required by page templates
Click to show internal directories.
Click to hide internal directories.