Skip to content

Instantly share code, notes, and snippets.

@stealthinu
Created June 27, 2013 08:20

Revisions

  1. stealthinu created this gist Jun 27, 2013.
    25 changes: 25 additions & 0 deletions BootstrapFormHelper_radio.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    diff --git a/View/Helper/BootstrapFormHelper.php b/View/Helper/BootstrapFormHelper.php
    index 89f9814..714709f 100644
    --- a/View/Helper/BootstrapFormHelper.php
    +++ b/View/Helper/BootstrapFormHelper.php
    @@ -114,10 +114,19 @@ class BootstrapFormHelper extends FormHelper {
    }

    public function radio($fieldName, $radioOptions = array(), $options = array()) {
    + $inlineFlag = false;
    + if (isset($options['inline']) and true == $options['inline']) {
    + $inlineFlag = true;
    + unset($options['inline']);
    + }
    $options['legend'] = false;
    $options['separator'] = "\n";
    $out = parent::radio($fieldName, $radioOptions, $options);
    - $out = $this->_restructureLabel($out, array('class' => 'radio'));
    + if ($inlineFlag) {
    + $out = $this->_restructureLabel($out, array('class' => 'radio inline'));
    + } else {
    + $out = $this->_restructureLabel($out, array('class' => 'radio'));
    + }
    return $out;
    }