MobileDeviceDetectionAttributes.php in Mobile Device Detection 8.2
File
src/Object/MobileDeviceDetectionAttributes.php
View source
<?php
namespace Drupal\mobile_device_detection\Object;
use Symfony\Component\Yaml\Yaml;
class MobileDeviceDetectionAttributes {
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;
}
}