2017 © Pedro Peláez
 

library html

Some helper classes to generate HTML tags from PHP.

image

phower/html

Some helper classes to generate HTML tags from PHP.

  • Saturday, July 25, 2015
  • by pedrobrazao
  • Repository
  • 1 Watchers
  • 0 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Phower Html

Some helper classes to generate HTML tags from PHP., (*1)

Instalation

This package uses Composer tool for auto-loading and dependency management. From your project root folder just run:, (*2)

composer require phower/html

Dependencies

This package depends on features from the following packages:, (*3)

  • phower/escaper - to have the generated HTML properly escaped against potential XSS attacks.

Usage

By definition any HTML tag must have a name and may also have attributes and a value. Tag value can be text, another tag or a mix of both., (*4)

To generate a new HTML tag with an anchor link to the Phower website using Phower\Html just do:, (*5)

<?php
use Phower\Html\Tag;
$a = new Tag('a', 'Phower', ['href' => 'http://phower.com']);
echo $a;

The output of the code above is a properly escaped HTML tag:, (*6)

<a href="http&#x3A;&#x2F;&#x2F;phower.com">Phower</a>

An extra helper method can also achieve the same result:, (*7)

<?php
use Phower\Html\Tag;
echo Tag::a('Phower', 'http://phower.com');

The Versions

25/07 2015

dev-master

9999999-dev https://github.com/phower/html

Some helper classes to generate HTML tags from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pedro Brazao Ferreira

25/07 2015

0.2.0

0.2.0.0 https://github.com/phower/html

Some helper classes to generate HTML tags from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pedro Brazao Ferreira

24/07 2015

0.1.0

0.1.0.0 https://github.com/phower/html

Some helper classes to generate HTML tags from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pedro Brazao Ferreira