https://github.com/Denitz/joomla-cms/blob/32469/libraries/cms/html/bootstrap.php#L462 is a good example