Methods to support locale in Hubleto project.
\Hubleto\Framework\Locale
Parent class | \Hubleto\Framework\Core |
Implements | \Hubleto\Framework\Interfaces\LocaleInterface |
Properties
locale
private array $locale
Methods
__construct
public __construct(): mixed
getDateShortFormat
[Description for getDateShortFormat]
public getDateShortFormat(): string
getDateLongFormat
[Description for getDateLongFormat]
public getDateLongFormat(): string
getDatetimeFormat
[Description for getDatetimeFormat]
public getDatetimeFormat(): string
getTimeFormat
[Description for getTimeFormat]
public getTimeFormat(bool $addSeconds = true): string
Parameters:
Parameter | Type | Description |
---|---|---|
$addSeconds |
bool |
getCurrencySymbol
[Description for getCurrencySymbol]
public getCurrencySymbol(): string
getCurrencyIsoCode
[Description for getCurrencyIsoCode]
public getCurrencyIsoCode(): string
getAll
[Description for getAll]
public getAll(string $keyBy = ""): array
Parameters:
Parameter | Type | Description |
---|---|---|
$keyBy |
string |
formatCurrency
[Description for formatCurrency]
public formatCurrency(string|float $value, string $symbol = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$value |
string|float | |
$symbol |
string |
formatDateShort
[Description for formatDateShort]
public formatDateShort(string|int $dateOrTimestamp): string
Parameters:
Parameter | Type | Description |
---|---|---|
$dateOrTimestamp |
string|int |
formatDateLong
[Description for formatDateLong]
public formatDateLong(string|int $dateOrTimestamp): string
Parameters:
Parameter | Type | Description |
---|---|---|
$dateOrTimestamp |
string|int |
formatDatetime
[Description for formatDatetime]
public formatDatetime(string|int $datetimeOrTimestamp): string
Parameters:
Parameter | Type | Description |
---|---|---|
$datetimeOrTimestamp |
string|int |
formatTime
[Description for formatTime]
public formatTime(string|int $timeOrTimestamp, bool $addSeconds = true): string
Parameters:
Parameter | Type | Description |
---|---|---|
$timeOrTimestamp |
string|int | |
$addSeconds |
bool |
Inherited methods
__construct
public __construct(): mixed
getServiceStatic
Shortcut for the dependency injection.
public static getServiceStatic(string $service): mixed
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$service |
string |
getService
[Description for getService]
public getService(string $service): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$service |
string |
env
Shortcut for the env service.
public env(): \Hubleto\Framework\Env
authProvider
Shortcut for the authentication service.
public authProvider(): \Hubleto\Framework\Interfaces\AuthInterface
db
Shortcut for the database service.
public db(): \Hubleto\Framework\Db
appManager
Shortcut for the app manager service.
public appManager(): \Hubleto\Framework\Interfaces\AppManagerInterface
router
Shortcut for the router service.
public router(): \Hubleto\Framework\Router
hookManager
Shortcut for the hook manager service.
public hookManager(): \Hubleto\Framework\HookManager
sessionManager
Shortcut for the session manager service.
public sessionManager(): \Hubleto\Framework\SessionManager
permissionsManager
Shortcut for the permissions manager service.
public permissionsManager(): \Hubleto\Framework\PermissionsManager
cronManager
Shortcut for the cron manager service.
public cronManager(): \Hubleto\Framework\CronManager
emailProvider
Shortcut for the email provider service.
public emailProvider(): \Hubleto\Framework\EmailProvider
config
Shortcut for the config service.
public config(): \Hubleto\Framework\Interfaces\ConfigManagerInterface
logger
Shortcut for the logger service.
public logger(): \Hubleto\Framework\Logger
locale
Shortcut for the locale service.
public locale(): \Hubleto\Framework\Locale
renderer
Shortcut for the renderer service.
public renderer(): \Hubleto\Framework\Renderer
translator
Shortcut for the translator service.
public translator(): \Hubleto\Framework\Interfaces\TranslatorInterface
getModel
[Description for getModel]
public getModel(string $model): \Hubleto\Framework\Models\Model
Parameters:
Parameter | Type | Description |
---|---|---|
$model |
string |
getController
[Description for getController]
public getController(string $controller): \Hubleto\Framework\Controller
Parameters:
Parameter | Type | Description |
---|---|---|
$controller |
string |
translate
Shorthand for core translate() function. Uses own language dictionary.
public translate(string $string, array $vars = []): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | String to be translated |
$vars |
array |
Return Value:
Translated string.