jaxwilko/elemental

There is no license information available for the latest version (dev-master) of this package.

dev-master 2018-12-29 01:34 UTC

This package is auto-updated.

Last update: 2024-04-23 08:54:05 UTC


README

This package offers a fluent html api for php.

As a simple example the following php:

<?php

require __DIR__ . '/vendor/autoload.php';

echo element('div')
    ->addClass('container')
    ->addChild(element('span')->text('this is a hat'))
    ->addChild(
        element('div')
            ->addChild(element('span')->addClass('something')->text('words'))
            ->addChild(element('input')->type('number')->value('666'))
    )
    ->addChild(element('img')->src('https://example.com/img.png'));

Will print:

<div class="container">
	<span>this is a hat</span>
	<div>
		<span class="something">words</span>
		<input type="number" value="666">
	</div>
	<img src="https://example.com/img.png">
</div>