ucscode/dom-element

A class constant contain all recognized HTML element tags

v1.0.1 2024-05-31 14:50 UTC

This package is auto-updated.

Last update: 2024-10-31 00:18:53 UTC


README

This file may contain other classes and functionalities in future, but for now, it's only a list of valid HTML name that you can use consistently in your project

interface DOMElementNameInterface
{
    public const NODE_A = 'A';
    public const NODE_BLOCKQUOTE = 'BLOCKQUOTE';
    public const NODE_BODY = 'BODY';
    public const NODE_BR = 'BR';
    public const NODE_BUTTON = 'BUTTON';
    public const NODE_FIELDSET = 'FIELDSET';
    public const NODE_H1 = 'H1';
    public const NODE_H2 = 'H2';
    // and so on...
}

Installation

You can install with composer:

composer require ucscode/dom-element

or you can download an include the script manuall using require or include keyword

require '/path/to/DOMElementNameInterface.php';

Usage

use Ucscode\DOMElement\DOMElementNameInterface;

$document = new DOMDocument();

$divElement = $document->createElement(DOMElementNameInterface::NODE_DIV);

$spanElement = new DOMElement(DOMElementNameInterface::NODE_SPAN);

// ...

Author

Create by Ucscode - Uchenna Ajah