Skip to content

LanguageHelper

App\Helpers\LanguageHelper

Get Language Value by Primary ID

php
LanguageHelper::fresnsLanguageByTableId($tableName, $tableColumn, $tableId, $langTag);
Parameter NameTypeRequiredDescription
tableNameStringrequiredTable name
tableColumnStringrequiredColumn name
tableIdNumberrequiredPrimary ID
langTagStringoptionalLanguage tag, not required
If passed, output content for the specified language tag.
If not passed, output values for all languages, format as below.
Return Example
json
[
    {
        "langTag": "Language Tag",
        "langContent": "Language Content",
    },
    {
        "langTag": "Language Tag",
        "langContent": "Language Content",
    }
]

Get Language Value by Configuration Key

php
LanguageHelper::fresnsLanguageByTableKey($tableKey, $itemType, $langTag);
Parameter NameTypeRequiredDescription
tableKeyStringrequiredConfiguration table Key
itemTypeStringoptionalData type, default is string
number / string / boolean / array / object
langTagStringoptionalLanguage tag, not required
If passed, output content for the specified language tag.
If not passed, output values for all languages, format as above.

Released under the Apache-2.0 License