Static
Static field type is used just to print some non editable data into the form.
<?php
$this->add('address', 'static', [
'tag' => 'div', // Tag to be used for holding static data,
'attr' => ['class' => 'form-control-static'], // This is the default
'value' => 'Static Text' // If nothing is passed, data is pulled from model if any
])
Generates html:
<div class="form-group">
<label for="address">Address</label>
<div class="form-control-static">Static Text</div>
</div>
<div class="form-group">
<label for="password">Password Confirmation</label>
<input type="password" name="password_confirmation">
</div>
Beside inherited, there are some additional options available:
tag
(String) (Default:div
) - Tag to be used