helpers.php
Global helper functions for Buffalo Eats Online.
Tags
Table of Contents
Functions
- __() : string
- Translate a key using the TranslationService.
- image_url() : string
- Get the public URL for an image storage path.
Functions
__()
Translate a key using the TranslationService.
__(string $key[, array<string|int, mixed> $replacements = [] ]) : string
Shorthand for TranslationService::getInstance()->get($key, $replacements). Falls back to English, then to the raw key name if no translation is found.
Parameters
- $key : string
-
Translation key
- $replacements : array<string|int, mixed> = []
-
Placeholder replacements (e.g., [':name' => 'John'])
Return values
string —Translated string
image_url()
Get the public URL for an image storage path.
image_url(string|null $storagePath) : string
Returns a placeholder for empty/null paths, otherwise delegates to the active storage driver for URL generation.
Parameters
- $storagePath : string|null
-
Relative storage path
Return values
string —Full URL or empty string