HtmlObject\Traits\Tag::__get PHP Method

__get() public method

Get an attribute or a child.
public __get ( string $item ) : mixed
$item string The desired child/attribute
return mixed
    public function __get($item)
    {
        if (array_key_exists($item, $this->attributes)) {
            return $this->attributes[$item];
        }
        // Get a child by snake case
        $child = preg_replace_callback('/([A-Z])/', function ($match) {
            return '.' . strtolower($match[1]);
        }, $item);
        $child = $this->getChild($child);
        return $child;
    }