⚙️
System

System Settings

Admin Settings

Database-driven configuration with type casting and encryption

Overview

Key-value configuration store in database. Supports multiple types (string, number, boolean, JSON, encrypted). Grouped for organization. Cached for performance with ConfigHelper.

Design Considerations

UX patterns and visual design notes for this feature:

  • Group settings logically (General, Email, Auth...)
  • Show descriptions - admins need context
  • Dangerous settings need confirmation dialogs
  • Visual feedback on save

Key Benefits

What makes this feature stand out:

  • No code changes for config updates
  • Type-safe value casting
  • Encrypted storage for secrets
  • Automatic caching
Technical Note

ConfigHelper::get('key', 'default') with caching. System settings override params.php values. Encrypted type uses Yii::$app->security for storage.

Helpers
ConfigHelper
Models
SystemSetting
Database Tables
system_setting

Configuration

Config Relationship Legend
DB overrides params.php🔗 DB related setting📋 DB stores value only
params.php Configuration

Config path: params['N/A (this IS the settings system)']

paramsConfigHelper::get('site_name', 'Default') => Get with fallbackparamsConfigHelper::getBool('maintenance_mode') => Type-cast to booleanparamsConfigHelper::set('key', 'value', 'string') => Set and cache
Database Settings (system_setting table)
KeyTypeDescriptionRelation
site_namestringSite name displayed in header
site_taglinestringSite tagline/slogan
smtp_passwordencryptedSMTP password (encrypted)📋
Note: This feature IS the bridge between params.php and database. Priority: DB system_setting > params.php > hardcoded defaults.