An open API service indexing awesome lists of open source software.

https://github.com/piotrpress/elementor

This library simplifies HTML elements rendering.
https://github.com/piotrpress/elementor

attribute attributes dom-element dom-elements element elementor elements html-attribute html-attributes html-dom html-dom-element html-element html-elements html-tag html-tags

Last synced: about 1 month ago
JSON representation

This library simplifies HTML elements rendering.

Awesome Lists containing this project

README

        

# Elementor

This library simplifies HTML elements rendering.

## Installation

```shell
$ composer require piotrpress/elementor
```

## Example

```php
require __DIR__ . '/vendor/autoload.php';

use PiotrPress\Elementor;
use PiotrPress\Elementor\Element;
use PiotrPress\Elementor\Attributes;

// Example #1
echo new Elementor( [
[ 'div',
[ 'class' => 'main' ],
[
[ 'input',
[
'type' => 'submit',
'required'
]
],
[ 'a',
[
'href' => 'https://piotr.press',
'class' => [ 'red', 'border' ]
],
'Click'
]
]
]
] );
//

// Example #2
echo new Element( 'a', [
'href' => 'https://piotr.press',
'class' => [ 'red', 'border' ]
], 'Click' );
// Click

// Example #3
echo new Element( 'input', [
'type' => 'submit',
'required'
] );
//

// Example #4
echo new Attributes( [
'href' => 'https://piotr.press',
'class' => [ 'red', 'border' ]
] );
// href="https://piotr.press" class="red border"
```

## Requirements

PHP >= `7.4` version.

## License

[MIT](license.txt)