<?php
use FarmaProm\TranslatableException\TranslatableException;
require_once __DIR__ . '/vendor/autoload.php';
class MyException extends TranslatableException
{
public function getTranslationKey()
{
return 'my_key';
}
public function getTranslationDomain()
{
return 'my_domain';
}
}
try {
throw (new MyException())->setTranslationParams(['param' => 'test']);
} catch (TranslatableException $e) {
var_export($e);
// Example usage with translator
// $translator->trans($e->getTranslationKey(), $e->getTranslationParams(), $e->getTranslationDomain());
}-
Notifications
You must be signed in to change notification settings - Fork 2
Exception that can be translated
License
fugi/translatable-exception
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Exception that can be translated
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published