All Features
Custom Fields (Variables)
Extensible custom fields for any entity with granular permissions
Overview
Flexible custom field system (Variables) that extends any entity with additional metadata. Supports 14 data types (string, integer, float, boolean, text, JSON, date, datetime, file, color, URL, email, select, multiselect). Includes per-variable view/edit role permissions, validation, encryption, and grouping.
Design Considerations
UX patterns and visual design notes for this feature:
- •Variables shown as separate tab in user settings
- •Group related variables together for better UX
- •Use appropriate input widgets per data type
- •Sensitive variables (SSN, tax ID) should be encrypted
- •Select/multiselect need predefined options in JSON config
Key Benefits
What makes this feature stand out:
- ✓14 data types supported
- ✓Granular role-based permissions per variable
- ✓Apply to any entity (User, Organization, Product, etc.)
- ✓Encryption support for sensitive data
- ✓Custom validation rules (Yii2 validators)
- ✓Grouping and ordering for organization
- ✓Render as form fields automatically
Variable model defines field schema. VariableValue stores actual values per entity. VariableHelper::getForEntity() retrieves values. VariableHelper::saveForEntity() persists values. Use VariableHelper::renderInput() to generate form fields. Variables are scoped to entity_type.
Helpers
VariableHelperModels
VariableVariableValueDatabase Tables
variablevariable_valueConfiguration
Config Relationship Legend
params.php Configuration
Config path: params['variables']
params['features']['variables'] => trueparams['variables']['enableUserVariables'] => trueparams['variables']['enableOrganizationVariables'] => true