Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ferg1e/corn-wand
PHP functional library for generating HTML
https://github.com/ferg1e/corn-wand
Last synced: 26 days ago
JSON representation
PHP functional library for generating HTML
- Host: GitHub
- URL: https://github.com/ferg1e/corn-wand
- Owner: ferg1e
- Created: 2014-04-13T22:58:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-10-07T00:58:01.000Z (about 7 years ago)
- Last Synced: 2024-07-24T09:25:32.126Z (3 months ago)
- Language: PHP
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Corn Wand
Corn Wand is a PHP functional library for generating HTML.
## Documentation
All functions have a DocBlock. So you can read the source code or
generate documentation with [phpDocumentor](http://phpdoc.org/).## Requirements
**PHP 5.3** or higher
## Source Code
The [project](https://github.com/al-codepone/corn-wand) is on GitHub.
The actual source code is in a [single file](https://github.com/al-codepone/corn-wand/blob/master/src/corn-wand.php).## Tests
All tests are in the [test directory](https://github.com/al-codepone/corn-wand/tree/master/test).
Each test is a standalone PHP script.
There is a test for each function; the name of the test script is the function name.
Some tag functions don't have tests.## Installation
Install using composer:
```javascript
{
"require": {
"corn-wand/corn-wand": "0.5.1",
}
}
```or you can install manually:
```php
require 'corn-wand.php';
```## Tag Functions
There's a function for each HTML tag. Here's the list of supported tags:
`a`, `abbr`, `address`, `area`, `article`, `aside`, `audio`, `b`, `base`,
`bdi`, `bdo`, `blockquote`, `body`, `br`, `button`, `canvas`, `caption`,
`cite`, `code`, `col`, `colgroup`, `content`, `data`, `datalist`, `dd`,
`decorator`, `del`, `details`, `dfn`, `div`, `dl`, `dt`, `element`, `em`,
`embed`, `fieldset`, `figcaption`, `figure`, `footer`, `form`, `h1`, `h2`,
`h3`, `h4`, `h5`, `h6`, `head`, `header`, `hr`, `html`, `i`, `iframe`,
`img`, `input`, `ins`, `kbd`, `keygen`, `label`, `legend`, `li`, `link`,
`main`, `map`, `mark`, `math`, `menu`, `menuitem`, `meta`, `meter`, `nav`,
`noscript`, `object`, `ol`, `optgroup`, `option`, `output`, `p`, `param`,
`pre`, `progress`, `q`, `rp`, `rt`, `ruby`, `s`, `samp`, `script`,
`section`, `select`, `shadow`, `small`, `source`, `span`, `strong`,
`style`, `sub`, `summary`, `sup`, `svg`, `table`, `tbody`, `td`, `template`,
`textarea`, `tfoot`, `th`, `thead`, `time`, `title`, `tr`, `track`, `u`,
`ul`, `var`, `video`, `wbr`.All tag function names are the name of the tag except for `var`. Use `_var()` instead.
All the tag functions work the same way: if the first agrument is an array then it is
the tag attributes. All other arguments are concatenated together to form the tag
content. Examples:```php
echo c\br(); //
echo c\html(); //
My Page
hi