<?php if ($showLabel && $showField): ?>
    <?php if ($options['wrapper'] !== false): ?>
    <div <?= $options['wrapperAttrs'] ?> >
    <?php endif; ?>
<?php endif; ?>

<?php if ($showLabel && $options['label'] !== false && $options['label_show']): ?>
    <?= Form::customLabel($name, $options['label'], $options['label_attr']) ?>
<?php endif; ?>

<?php if ($showField): ?>
    <?php if (isset($options['form_horizontal']) && $options['form_horizontal'] == true && $type !== 'hidden'): ?><div class="col-sm-9"><?php endif; ?>
    <?= Form::input($type, $name, $options['value'], $options['attr']) ?>

    <?php include 'help_block.php' ?>
    <?php if (isset($options['form_horizontal']) && $options['form_horizontal'] == true && $type !== 'hidden'): ?></div><?php endif; ?>
<?php endif; ?>

<?php if (isset($options['form_horizontal']) && $options['form_horizontal'] == true && $type !== 'hidden'): ?><div class="row"><div class="col-sm-9 col-sm-offset-3"><?php endif; ?>
<?php include 'errors.php' ?>
<?php if (isset($options['form_horizontal']) && $options['form_horizontal'] == true && $type !== 'hidden'): ?></div></div><?php endif; ?>

<?php if ($showLabel && $showField): ?>
    <?php if ($options['wrapper'] !== false): ?>
    </div>
    <?php endif; ?>
<?php endif; ?>
