Skip to content

Repository files navigation

Sirius HTML

Source CodeLatest VersionSoftware LicenseBuild StatusCoverage StatusQuality Score

Framework agnostic HTML rendering utility with an API inspired by jQuery and React.

Elevator pitch

$h = newSirius\Html\Builder;
$h->registerTag('user-login-form', 'MyApp\Html\Components\UserLoginForm');
echo$h->make('user-login-form', ['_form_values' => $_POST]);

which will output something like

<formmethod="post" action="user/login" class="form form-inline"><divclass="form-control"><labelfor="email">Email/Username:</label><inputtype="email" name="email" id="email" value="me@domain.com"></div><!-- the rest of the form goes here --></form>

Performance

There is a simple benchmark that renders a form with 4 fields and a button. Compared to Twig, Sirius HTML is 50% slower but uses 2x less memory.

The benchmark results are as follows for 100K iterations:

LibraryTimeMemory
Sirius HTML1.78s2Mb
Twig1.14s4Mb

Of course, this is not a real world scenario, but it gives you an idea of what to expect from this library.

Links

Releases

Packages

Used by

Contributors

Languages