2017 © Pedro Peláez
 

library html

Adi HTML Tools for PHP

image

adilab/html

Adi HTML Tools for PHP

  • Saturday, April 16, 2016
  • by adilab
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Adi HTML Tools for PHP

Adi HTML Tools for PHP is a set of class for prepare HTML code directly in PHP. The set content class for work with basic HTML tags, and to create HTML table code taking data from an array., (*1)

Installing

Preferred way to install is with Composer., (*2)

Install this library using composer:, (*3)

$ composer require adilab/html

Usage:

Usage of Tag class. Online demo., (*4)

require('vendor/autoload.php');

use Adi\Html\Tag;

$p = new Tag('p', 'Hello world');
$p->addStyle('color: #ff0000')->addStyle('background-color', '#ccc');
echo $p->render();

Usage of complex HTML structure. Online demo., (*5)

require('vendor/autoload.php');

use Adi\Html\Div;
use Adi\Html\Strong;

echo Div::create(Strong::create('Hello world'))->setStyle('color: #ff0000');

Usage of Table class. Online demo., (*6)

require('vendor/autoload.php');
use Adi\Html\Table\Table;
use Adi\Html\Table\Tr;
use Adi\Html\Table\Td;

$data = array(
    array('aaa', 'bbb', Td::create('ccc')->addClass('ccc')),
    array('ddd', 'eee', 'fff'),
    Tr::create(array('ggg', 'hhh', 'iii'))->addClass('selected'),
);

echo Table::create($data);

Usage of Table class - named columns. Online demo., (*7)

require('vendor/autoload.php');
use Adi\Html\Table\Table;
use Adi\Html\Table\Th;
use Adi\Html\Table\Tr;
use Adi\Html\Table\Column;
use Adi\Html\Table\Td;

$data = array(
    array('A' => 'aaa', 'B' => 'bbb', 'C' => 'ccc'),
    array('A' => 'ddd', 'B' => 'eee', 'C' => 'fff'),
    array('A' => 'ggg', 'B' => 'hhh', 'C' => Td::create('iii')->setId('i')),
);

$table = new Table($data);
$table->setColumn('B', Column::create()->addStyle('color', '#ff0000'));
$table->setHeader('B', '[B]');
$table->setHeader('C', Th::create('[C]')->addStyle('color', '#0000ff'));
echo $table;

Documentation

API documentacion, (*8)

The Versions

16/04 2016

dev-master

9999999-dev https://github.com/adilab/html.git

Adi HTML Tools for PHP

  Sources   Download

MIT

The Requires

 

by Adrian Zurkiewicz

16/04 2016

v1.0.0

1.0.0.0 https://github.com/adilab/html.git

Adi HTML Tools for PHP

  Sources   Download

MIT

The Requires

 

by Adrian Zurkiewicz

15/04 2016

v0.0.1

0.0.1.0 https://github.com/adilab/html.git

Adi HTML Tools for PHP

  Sources   Download

MIT

The Requires

 

by Adrian Zurkiewicz