Back to Document class

Method setLanguage

public \Joomla\CMS\Document\Document
setLanguage
(mixed $lang = 'en-gb')
Sets the global document language declaration. Default is English (en-gb).
Parameters
  • string $lang The language to be set
Returns
  • \Joomla\CMS\Document\Document instance of $this to allow chaining
Since
  • 1.7.0
Class: Document
Project: Joomla

Method setLanguage - Source code

/**
 * Sets the global document language declaration. Default is English (en-gb).
 *
 * @param   string  $lang  The language to be set
 *
 * @return  Document instance of $this to allow chaining
 *
 * @since   1.7.0
 */
public function setLanguage($lang = 'en-gb')
{
    $this->language = strtolower($lang);
    return $this;
}