<div class="control-group <?php print $ccss; ?> <?php print (isset($error) ? 'error' : ''); ?>">
    <?php if ($label): ?>
        <label class="control-label" for="<?php print $id ?>"><?php print $label; ?></label>
    <?php endif; ?>

    <div class="controls">
        <input id="<?php print $id; ?>" type="<?php print $type; ?>" class="<?php print $css; ?>"
               name="<?php print $name; ?>" <?php print isset($value) ? ' value="' . $value . '"' : '' ?> <?php print isset($pattern) ? ' pattern="' . $pattern . '"' : '' ?> <?php print $required ? ' required' : '' ?>>

        <?php if (isset($error)): ?>
            <span class="help-block"><?php print $error; ?></span>
        <?php endif; ?>
    </div>
</div>
