Home / Code Examples / Helper Functions

Helper Functions

Common helper functions

Helper Functions Reference

The system provides helper functions for common operations.

Output & Security

// Escape output for HTML
echo e($userInput);

// Generate URL
$url = url('/client/invoices');

// Redirect
redirect('/admin/dashboard');

Currency & Formatting

// Format currency
echo formatCurrency(100.50, 'USD');

// Format date
echo formatDate('2024-01-15');

Settings

// Get setting
$value = getSetting('setting_key', 'default');

// Set setting
setSetting('setting_key', 'value');

Security Note: Always use e() to escape user input before output.