class MobileDeviceDetectionAttributes in Mobile Device Detection 8.3
Same name and namespace in other branches
- 8 src/Object/MobileDeviceDetectionAttributes.php \Drupal\mobile_device_detection\Object\MobileDeviceDetectionAttributes
- 8.2 src/Object/MobileDeviceDetectionAttributes.php \Drupal\mobile_device_detection\Object\MobileDeviceDetectionAttributes
MobileDeviceDetectionAttributes class.
Hierarchy
- class \Drupal\mobile_device_detection\Object\MobileDeviceDetectionAttributes
Expanded class hierarchy of MobileDeviceDetectionAttributes
1 string reference to 'MobileDeviceDetectionAttributes'
1 service uses MobileDeviceDetectionAttributes
File
- src/
Object/ MobileDeviceDetectionAttributes.php, line 10
Namespace
Drupal\mobile_device_detection\ObjectView source
class MobileDeviceDetectionAttributes {
/**
* {@inheritdoc}
*/
public function get($attribute = NULL) {
$file = __DIR__ . '/../../config/attributes/attributes.yml';
if (!file_exists($file)) {
return FALSE;
}
$attributes = Yaml::parse(file_get_contents($file))['attributes'];
if (!is_null($attribute)) {
return $attributes[$attribute];
}
return $attributes;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MobileDeviceDetectionAttributes:: |
public | function |