<?php $this->extend('form_row'); ?>

<?php $this->block('field'); ?>
  <fieldset id="ctrl_<?= $this->id ?>" class="radio_container<?php if ($this->class) echo ' ' . $this->class; ?>">

    <?php if ($this->label): ?>
      <legend>
        <?php if ($this->mandatory): ?>
          <span class="invisible"><?= $this->mandatoryField ?></span> <?= $this->label ?><span class="mandatory">*</span>
        <?php else: ?>
          <?= $this->label ?>
        <?php endif; ?>
      </legend>
    <?php endif; ?>

    <?php if ($this->hasErrors()): ?>
      <p class="error"><?= $this->getErrorAsString() ?></p>
    <?php endif; ?>

    <?php foreach ($this->getOptions() as $option): ?>
      <span><input type="radio" name="<?= $option['name'] ?>" id="opt_<?= $option['id'] ?>" class="radio" value="<?= $option['value'] ?>"<?= $option['checked'] ?><?= $option['attributes'] ?> /> <label id="lbl_<?= $option['id'] ?>" for="opt_<?= $option['id'] ?>"><?= $option['label'] ?></label></span>
    <?php endforeach; ?>

  </fieldset>

  <?php if ($this->addSubmit): ?>
    <input type="submit" id="ctrl_<?= $this->id ?>_submit" class="submit" value="<?= $this->slabel ?>" />
  <?php endif; ?>
<?php $this->endblock(); ?>
