Documentation ¶
Index ¶
- func ExitWithMsg(msg interface{}, value ...interface{})
- func GetLocale(context *qor.Context) string
- func HumanizeString(str string) string
- func ModelType(value interface{}) reflect.Type
- func NewValue(t reflect.Type) (v reflect.Value)
- func ParseTagOption(str string) map[string]string
- func PatchURL(originalURL string, params ...interface{}) (patchedURL string, err error)
- func Stringify(object interface{}) string
- func ToArray(value interface{}) (values []string)
- func ToFloat(value interface{}) float64
- func ToInt(value interface{}) int64
- func ToParamString(str string) string
- func ToString(value interface{}) string
- func ToUint(value interface{}) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExitWithMsg ¶
func ExitWithMsg(msg interface{}, value ...interface{})
ExitWithMsg debug error messages and print stack
func GetLocale ¶
GetLocale get locale from request, cookie, after get the locale, will write the locale to the cookie if possible
func HumanizeString ¶
HumanizeString Humanize separates string based on capitalizd letters e.g. "OrderItem" -> "Order Item"
func ParseTagOption ¶
ParseTagOption parse tag options to hash
func PatchURL ¶
PatchURL updates the query part of the current request url. You can access it in template by `patch_url`.
patch_url "google.com" "key" "value"
func Stringify ¶
func Stringify(object interface{}) string
Stringify stringify any data, if it is a struct, will try to use its Name, Title, Code field, else will use its primary key
func ToArray ¶
func ToArray(value interface{}) (values []string)
ToArray get array from value, will ignore blank string to convert it to array
func ToFloat ¶
func ToFloat(value interface{}) float64
ToFloat get float from value, if passed value is empty string, result will be 0
func ToInt ¶
func ToInt(value interface{}) int64
ToInt get int from value, if passed value is empty string, result will be 0
func ToParamString ¶
ToParamString replaces spaces and separates words (by uppercase letters) with underscores in a string, also downcase it e.g. ToParamString -> to_param_string, To ParamString -> to_param_string
Types ¶
This section is empty.