private function getValue(array $attributes, $name, $default = null) { if (array_key_exists($name, $attributes) && !empty($attributes[$name])) { return $attributes[$name]; } return $default; }