Skip to content

Configuration

get()

get() — returns any

Available in: controller, model, test, migrator, migration, tabledefinition Category: Miscellaneous Functions

Returns the current value of a Wheels configuration setting or the default value for a specific function argument. It can be used to inspect global Wheels settings (like table name prefixes, pagination defaults, or other configuration values) or to check what the default argument would be for a particular Wheels function.

NameTypeRequiredDefaultDescription
namestringyesVariable name to get setting for.
functionNamestringnoFunction name to get setting for.
1. Get the current value of a global Wheels setting
tablePrefix = get("tableNamePrefix");

2. Get the default message for the `validatesConfirmationOf` function
confirmationMessageDefault = get(functionName="validatesConfirmationOf", name="message");

3. Check the default value for the "null" argument in migrations
allowNullDefault = get(functionName="float", name="null");

4. Retrieve the current default number of rows per page in pagination
perPageDefault = get("perPage");