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

https://github.com/arxcode40/html5-php

Generate HTML5 element using PHP
https://github.com/arxcode40/html5-php

html html5 php

Last synced: 11 months ago
JSON representation

Generate HTML5 element using PHP

Awesome Lists containing this project

README

          

# HTML5 PHP

## Description
Helper for generate HTML5 element.

## Syntax
```php
html5(
string $tag = 'doctype',
array $attributes = [],
mixed ...$children
): string
```

## Parameters
#### tag

The HTML5 tag.

#### attributes

The HTML5 attributes.

#### children

The HTML5 children.

## Return Values
Return the HTML5 element.

## Examples
**Example #1: Basic example**

```php
echo html5('div', ['class' => 'row'],
html5('div', ['class' => ['col-sm-8', 'col-md-6']], '')
);
```
```html




```

**Example #2: Doctype declaration**
```php
echo html5();
```
```html

```

**Example #3: Multiple children**
```php
echo html5('ul', [],
html5('li', [], ''),
html5('li', [], '')
);
```
```html





```

**Example #4: Self-closing tags**
```php
echo html5('input', [
'required' => true,
'style' => [
'display' => 'block'
],
'type' => 'text'
]);
```
```html

```