Back to Cache class

Method getPlatformPrefix

public static string
getPlatformPrefix
()
Set a prefix cache key if device calls for separate caching
Returns
  • string
Since
  • 3.5
Class: Cache
Project: Joomla

Method getPlatformPrefix - Source code

/**
 * Set a prefix cache key if device calls for separate caching
 *
 * @return  string
 *
 * @since   3.5
 */
public static function getPlatformPrefix()
{
    // No prefix when Global Config is set to no platform specific prefix
    if (!Factory::getApplication()->get('cache_platformprefix', false)) {
        return '';
    }
    $webclient = new WebClient();
    if ($webclient->mobile) {
        return 'M-';
    }
    return '';
}