Swat/SwatRadioButtonCellRenderer.php
public function render()
    {
        if (!$this->visible) {
            return;
        }

        parent::render();

        if ($this->title !== null) {
            $label_tag = new SwatHtmlTag('label');
            $label_tag->for = $this->id . '_radio_button_' . $this->value;
            $label_tag->setContent($this->title, $this->content_type);
            $label_tag->open();
        }

        $radio_button_tag = new SwatHtmlTag('input');
        $radio_button_tag->type = 'radio';
        $radio_button_tag->name = $this->id;
        $radio_button_tag->id = $this->id . '_radio_button_' . $this->value;
        $radio_button_tag->value = $this->value;
        if (!$this->sensitive) {
            $radio_button_tag->disabled = 'disabled';
        }

        $view = $this->getFirstAncestor('SwatView');
        if ($view !== null) {
            $selection = $view->getSelection($this);
            if ($selection->contains($this->value)) {
                $radio_button_tag->checked = 'checked';
            }
        }

        echo '<span class="swat-radio-wrapper">';
        $radio_button_tag->display();
        echo '<span class="swat-radio-shim"></span>';
        echo '</span>';

        if ($this->title !== null) {
            $label_tag->displayContent();
            $label_tag->close();
        }
    }
public function render()
    {
        if (!$this->visible) {
            return;
        }

        parent::render();

        if ($this->title !== null) {
            $label_tag = new SwatHtmlTag('label');
            $label_tag->for = $this->id . '_radio_button_' . $this->value;
            $label_tag->setContent($this->title, $this->content_type);
            $label_tag->open();
        }

        $radio_button_tag = new SwatHtmlTag('input');
        $radio_button_tag->type = 'radio';
        $radio_button_tag->name = $this->id;
        $radio_button_tag->id = $this->id . '_radio_button_' . $this->value;
        $radio_button_tag->value = $this->value;
        if (!$this->sensitive) {
            $radio_button_tag->disabled = 'disabled';
        }

        $view = $this->getFirstAncestor('SwatView');
        if ($view !== null) {
            $selection = $view->getSelection($this);
            if ($selection->contains($this->value)) {
                $radio_button_tag->checked = 'checked';
            }
        }

        echo '<span class="swat-radio-wrapper">';
        $radio_button_tag->display();
        echo '<span class="swat-radio-shim"></span>';
        echo '</span>';

        if ($this->title !== null) {
            $label_tag->displayContent();
            $label_tag->close();
        }
    }
public function render ( ) { if ( ! $ this -> visible ) { return ; } parent :: render ( ) ; if ( $ this -> title !== null ) { $ label_tag = new SwatHtmlTag ( 'label' ) ; $ label_tag -> for = $ this -> id . '_radio_button_' . $ this -> value ; $ label_tag -> setContent ( $ this -> title , $ this -> content_type ) ; $ label_tag -> open ( ) ; } $ radio_button_tag = new SwatHtmlTag ( 'input' ) ; $ radio_button_tag -> type = 'radio' ; $ radio_button_tag -> name = $ this -> id ; $ radio_button_tag -> id = $ this -> id . '_radio_button_' . $ this -> value ; $ radio_button_tag -> value = $ this -> value ; if ( ! $ this -> sensitive ) { $ radio_button_tag -> disabled = 'disabled' ; } $ view = $ this -> getFirstAncestor ( 'SwatView' ) ; if ( $ view !== null ) { $ selection = $ view -> getSelection ( $ this ) ; if ( $ selection -> contains ( $ this -> value ) ) { $ radio_button_tag -> checked = 'checked' ; } } echo '<span class="swat-radio-wrapper">' ; $ radio_button_tag -> display ( ) ; echo '<span class="swat-radio-shim"></span>' ; echo '</span>' ; if ( $ this -> title !== null ) { $ label_tag -> displayContent ( ) ; $ label_tag -> close ( ) ; } }
Renders this radio button cell renderer
Renders this radio button cell renderer