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
- Host: GitHub
- URL: https://github.com/thipages/quicktag
- Owner: thipages
- License: mit
- Created: 2020-04-05T11:53:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T07:23:19.000Z (over 5 years ago)
- Last Synced: 2025-03-09T16:36:37.771Z (11 months ago)
- Topics: html, php, quick, tag
- Language: PHP
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
/* */
```