Cuppa Documentation

Find information related with: installation, user interface, best practices, improve and extend de functionalities, front-end integration and more.

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


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 = $cuppa->language->current(); // return the current language selected

set($language = "en", $forced = true)

$cuppa->language->set('es'); // Change the language to 'es'


$languages = $cuppa->language->languages(); // return the languages list in an array ['en', 'es', 'fr']


$valid = $cuppa->language->validLanguage('es'); // return true or false if the language is available or not