2017 © Pedro Peláez
 

library html

image

phore/html

  • Friday, July 13, 2018
  • by dermatthes
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Phore HTML Toolkit

  • Fluent API for creating HTML Elements
  • Create, alter, render

Basic example

// Create a div element:
$elem = fhtml("div @id=main @class=website");

// Append a 

<

div id=content> to the 
$elem[] = [
    "div @id=content" => "Some Content"
];

// Append paragraph to content div: 
$elem["?#content"][] = ["p" => "Some escaped content"];

// Render full page including html-header
echo $elem->renderPage(); 

will output:, (*1)

<div id="main" class="website">
    <div id="content">
        Some Content
        <p>Some escaped content</p>
    </div>
</div>

Creating html structures

$doc = fhtml("div @id=name2 @class=bordered");
$doc->alter();

Rendering Templates

Appending to Templates

Use the array append syntax ($template[] =) to append elements to an existing element:, (*2)

$t = fhtml();

$t[] = ["@h1" => "Hello World"];

The Versions

13/07 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >7.0
  • ext-pcre *

 

The Development Requires