Skip to content

Configuration

set()

set() — returns void

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

Used to configure global settings or set default argument values for Wheels functions. It can be applied to core functions, helpers, and even migrations. This allows you to define a standard behavior across your application without repeating arguments every time a function is called.

1. Set the `URLRewriting` setting to `Partial`.
set(URLRewriting="Partial");

2. Set default values for the arguments in the `buttonTo` view helper. This works for the majority of Wheels functions/arguments.
set(functionName="buttonTo", onlyPath=true, host="", protocol="", port=0, text="", confirm="", image="", disable="");

3. Set the default values for a form helper to get the form marked up to your preferences.
set(functionName="textField", labelPlacement="before", prependToLabel="<div>", append="</div>", appendToLabel="<br>"):