public static function uses($slug)
    {
        if (empty(static::$_modes[$slug])) {
            throw new InternalErrorException(__d('cms', 'Illegal usage of ViewModeRegistry::uses(), view mode "{0}" was not found.', $slug));
        }

        static::$_current = $slug;
    }
public static function uses($slug)
    {
        if (empty(static::$_modes[$slug])) {
            throw new InternalErrorException(__d('cms', 'Illegal usage of ViewModeRegistry::uses(), view mode "{0}" was not found.', $slug));
        }

        static::$_current = $slug;
    }
public static function uses ( $ slug ) { if ( empty ( static :: $ _modes [ $ slug ] ) ) { throw new InternalErrorException ( __d ( 'cms' , 'Illegal usage of ViewModeRegistry::uses(), view mode "{0}" was not found.' , $ slug ) ) ; } static :: $ _current = $ slug ; }
Marks as "in use" the given view mode.

The given view mode must be registered first using `add()`. If you
try to switch to an unexisting (unregistered) view mode this method will
throw and exception.

@param string $slug View mode machine name to switch to
@return void
@throws \Cake\Network\Exception\InternalErrorException When switching to an
unregistered view mode
Marks as in use the given view mode .