You are here

function hook_browserclass_classes in Browser Class 7

Same name and namespace in other branches
  1. 6 browserclass.api.php \hook_browserclass_classes()

Add new classes to the body.

The returnd array will merged with browserclass module's detected classes. Create the conditions by user agent.

Parameters

string $agent: Lowercase version of user agent.

Return value

array An array of defined classes.

1 invocation of hook_browserclass_classes()
browserclass_get_classes in ./browserclass.module
Get classes.

File

./browserclass.api.php, line 20
Sample hooks demonstrating usage in Browser class module.

Code

function hook_browserclass_classes($agent) {
  $classes = [];
  if (stristr($agent, 'something') !== FALSE) {
    $classes[] = 'myclass';
  }
  if (stristr($agent, 'something2') !== FALSE) {
    $classes[] = 'myclass2';
  }
  return $classes;
}