Skip to content

Global Helpers

Global Helpers

  • appCacheClear() — Removes every entry from the application data cache. The framework’s own caches (actions, pages,
  • appCacheDelete() — Removes the entry for key. Returns true when there was an unexpired entry to remove.
  • appCacheExists() — Returns true when an unexpired entry exists for key, even one holding false, <cod
  • appCacheFetch() — Returns the value cached under key. On a miss, calls callback, caches what it returns for <cod
  • appCacheRead() — Returns the value cached under key, or defaultValue when there is no unexpired entry. A cached
  • appCacheWrite() — Caches value under key for time, replacing any entry already there. Complex value
  • capitalize() — Capitalizes the first character of the supplied string.
  • controller() — Creates and returns a controller object with your own custom name and params.
  • deobfuscateParam() — Deobfuscates a value.
  • distanceOfTimeInWords() — Pass in two dates to this method, and it will return a string describing the difference between them.
  • escapeForLike() — Escapes the LIKE wildcards in a string so it can be used as a literal search term in a
  • excerpt() — Extracts an excerpt from text that matches the first instance of a given phrase.
  • generateUUID() — Generates a 36-character UUID compatible with SQL Server’s uniqueidentifier.
  • humanize() — Returns readable text by capitalizing and converting camel casing to multiple words.
  • hyphenize() — Converts camelCase strings to lowercase strings with hyphens as word delimiters instead. Example: myVariable becomes my-
  • injector() — Return a reference to the DI container for direct configuration.
  • mimeTypes() — Returns an associated MIME type based on a file extension.
  • model() — Returns a reference to the requested model so that class level methods can be called on it.
  • obfuscateParam() — Obfuscates a value. Typically used for hiding primary key values when passed along in the URL.
  • pluginNames() — Returns a list of the names of all installed plugins.
  • pluralize() — Returns the plural form of the passed in word. Can also pluralize a word based on a value passed to the count</cod
  • publish() — Publish an event to a channel.
  • service() — Resolve a DI-registered service by name.
  • singularize() — Returns the singular form of the passed in word.
  • timeAgoInWords() — Returns a string describing the approximate time difference between the date passed in and the current date.
  • timeUntilInWords() — Returns a string describing the approximate time difference between the current date and the date passed in.
  • titleize() — Capitalizes all words in the text to create a nicer looking title.
  • truncate() — Truncates text to the specified length and replaces the last characters with the specified truncate string (which defaul
  • URLFor() — Creates an internal URL based on supplied arguments.
  • wordTruncate() — Truncates text to the specified length of words and replaces the remaining characters with the specified truncate string