Skip to content

jaxwilko/elemental

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elemental

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>

About

A fluent html api for php

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages