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.
- Host: GitHub
- URL: https://github.com/piotrpress/elementor
- Owner: PiotrPress
- License: mit
- Created: 2022-10-20T15:05:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T08:46:20.000Z (8 months ago)
- Last Synced: 2024-10-29T00:39:25.058Z (7 months ago)
- Topics: 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
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
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)