A simple template system, write once run everywhere with JavaScript (nodejs or in browser ), PHP ...
$ composer require silassare/otpl-php
<label for="<% $.input.id %>"><% $.label.text %></label>
<input <% @HtmlSetAttr($.input) %> />
<?php
require_once "vendor/autoload.php";
$otpl = new \OTpl\OTpl();
$otpl->parse('template.otpl');
$data = array(
'label' => array(
'text' => 'Your password please :',
),
'input' => array(
'id' => 'pass_field',
'type' => 'password',
'name' => 'pass'
)
);
$otpl->runWith($data);
<label for="pass_field">Your password please :</label>
<input type="password" id="pass_field" name="pass" />