Skip to content

Global Helpers

Global Helpers

  • capitalize() — Capitalizes the first letter of every word in the provided text, creating a nicely formatted title or sentence.
  • controller() — The controller() function creates and returns a controller object with a custom name and optional parameters. It is prim
  • deobfuscateParam() — Converts an obfuscated string back into its original value. This is typically used when IDs or other sensitive data are
  • distanceOfTimeInWords() — Pass in two dates to this method, and it will return a string describing the difference between them.
  • excerpt() — excerpt() extracts a portion of text surrounding the first instance of a given phrase. This is useful for previews, sear
  • humanize() — Converts a camel-cased or underscored string into more readable, human-friendly text by inserting spaces and capitalizin
  • hyphenize() — Converts camelCase or PascalCase strings into lowercase hyphen-separated strings. Useful for generating URL-friendly slu
  • mimeTypes() — Returns the associated MIME type for a given file extension. Useful when serving files dynamically or setting response h
  • model() — Returns a reference to a specific model defined in your application, allowing you to call class-level methods on it. Thi
  • obfuscateParam() — Obfuscates a value, typically used to hide sensitive information like primary key IDs when passing them in URLs. This he
  • pluginNames() — Returns a list of all installed Wheels plugins in your application. This can be useful if you want to check for the pres
  • pluralize() — Returns the plural form of the passed in word. Can also pluralize a word based on a value passed to the count</cod
  • singularize() — Converts a plural word into its singular form. It uses Wheels’ built-in inflection rules, handling common English plural
  • timeAgoInWords() — Returns a human-friendly string describing the approximate time difference between two dates (defaults to comparing agai
  • timeUntilInWords() — Returns a human-readable string describing the approximate time difference between the current date (or another starting
  • titleize() — Converts a string so that the first letter of each word is capitalized, producing a cleaner, title-like appearance. It i
  • truncate() — Shortens a given text string to a specified length and appends a replacement string (by default ”…”) at the end to ind
  • URLFor() — Generates an internal URL based on the supplied arguments. It can create URLs using a named route, or by specifying a co
  • wordTruncate() — Truncates text to the specified length of words and replaces the remaining characters with the specified truncate string