Installation
Back End
Configure tables
Filters
Menu manager
Users and groups
Language manager
Permissions and access levels
Personal components
Configuration panel
Front End
PHP famework
Database
Menu
Language
User
Mail
General methods
setPath
setDocumentPath
getPath
getDocumentPath
setSessionVar
getSessionVar
echoString
GET
POST
REQUEST
administratorFolder
API Rest
Language
load($file = "administrator", $language = null)
$language = $cuppa->language->load("web"); // return the language like a object
echo $language->read_more // print the translation of read_more in the language configured
getValue($key, $language_file_reference, $convert_to_url_friendy = false)
echo $cuppa->language->getValue('label', 'web'); // load the 'web' file and return the translate value with the label specified
getValueRich($label)
This method return the value created in the section Language Manager > Rich content
echo $cuppa->language->getValueRich('footer'); // return the content with the label 'footer'
current()
$current = $cuppa->language->current(); // return the current language selected
set($language = "en", $forced = true)
$cuppa->language->set('es'); // Change the language to 'es'
languages()
$languages = $cuppa->language->languages(); // return the languages list in an array ['en', 'es', 'fr']
validLanguage($value)
$valid = $cuppa->language->validLanguage('es'); // return true or false if the language is available or not