class MobileDeviceDetectionAttributes in Mobile Device Detection 8
Same name and namespace in other branches
- 8.3 src/Object/MobileDeviceDetectionAttributes.php \Drupal\mobile_device_detection\Object\MobileDeviceDetectionAttributes
- 8.2 src/Object/MobileDeviceDetectionAttributes.php \Drupal\mobile_device_detection\Object\MobileDeviceDetectionAttributes
Hierarchy
- class \Drupal\mobile_device_detection\Object\MobileDeviceDetectionAttributes
Expanded class hierarchy of MobileDeviceDetectionAttributes
2 files declare their use of MobileDeviceDetectionAttributes
- MobileDeviceDetection.php in src/
Object/ MobileDeviceDetection.php - MobileDeviceDetectionObject.php in src/
Object/ MobileDeviceDetectionObject.php
1 string reference to 'MobileDeviceDetectionAttributes'
1 service uses MobileDeviceDetectionAttributes
File
- src/
Object/ MobileDeviceDetectionAttributes.php, line 7
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 |