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

https://github.com/thipages/quicktag

Quick Html tags builder
https://github.com/thipages/quicktag

html php quick tag

Last synced: 3 months ago
JSON representation

Quick Html tags builder

Awesome Lists containing this project

README

          

# quicktag
Quick Html tags builder

### Installation
**composer** require thipages\quicktag

### Usage of QTag class
#### Basic usage
Maps are associative arrays mapping tags attributes
```php
// *************
// CONTENT TAGS
// *************
QTag::tag ($tag, ...$map)($content) : String
QTag::tag ($tag, ...$map1)($content,$map2]) : String
// *************
// VOID TAGS
// *************
QTag::tag ($tag, ...$map):String
```
##### Examples
```php
$blue=['style'=>'color:blue'];

$html=QTag::tag('span',$blue)('Hello QTag');
/* Hello QTag */

$html=QTag::tag('input', ['type'=>'num','min'=>2]);
/* */
```

Templating usage - Content tags

```php
QTag::tag ($tag, ...$map1)[($content, ...$map2, true)]n($content, ...$mapN) : String
```
Examples
```php
$blue=['style'=>'color:blue'];

$template=QTag::tag('span',$blue)('Hello QTag', true);
$html=$template('...and more");
/* Hello QTag...and more */
```

Templating usage - Void tags

```php
QTag::tag ($tag, ...$map1, true)[(...$map2, true)]n(...$mapN) : String
```
##### Examples
```php
$blue=['style'=>'color:blue'];
$min=['min'=>2];

$template=QTag::tag('input',$blue, true);
$html=$template($min);
/* */
```