Example 1
$form = new Form('plugins-material-timepicker-form-1', 'horizontal');
$form->addInput('text', 'm-time', '', 'Time: ', 'required');
$form->addPlugin('material-timepicker', '#m-time');
<div class="row mb-3">
<label for="m-time" class="col-sm-4 col-form-label">
Time: <sup class="text-danger">* </sup>
</label>
<div class="col-sm-8">
<input id="m-time" name="m-time" type="text" value="" required class="form-control">
</div>
</div>
Example 2 - 24 hours Time
$form = new Form('plugins-material-timepicker-form-2', 'horizontal');
$form->addInput('text', 'm-time-2', '', 'Time: ', 'data-twelve-hour=false, required');
$form->addPlugin('material-timepicker', '#m-time-2');
<div class="row mb-3">
<label for="m-time-2" class="col-sm-4 col-form-label">
Time: <sup class="text-danger">* </sup>
</label>
<div class="col-sm-8">
<input id="m-time-2" name="m-time-2" type="text" value="" data-twelve-hour="false" required class="form-control">
</div>
</div>
Example 3 - Translation (i18n)
$form = new Form('plugins-material-timepicker-form-3', 'horizontal');
$form->addInput('text', 'm-time-3', '', 'Time: ', 'required');
$form->addPlugin('material-timepicker', '#m-time-3', 'default', array('language' => 'fr_FR'));
// We cannot show the timepicker translated here
// because using several different languages on the same page will throw an error.