Framework agnostic HTML rendering utility with an API inspired by jQuery and React.
$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>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:
| Library | Time | Memory |
|---|---|---|
| Sirius HTML | 1.78s | 2Mb |
| Twig | 1.14s | 4Mb |
Of course, this is not a real world scenario, but it gives you an idea of what to expect from this library.