public function render() { return Tart::form($this, function ($h, $self) { $h('label', __($self->label())); $h->add($self->parent()->form()->radios($self->name(), array('choices' => $self->params(), 'include_blank' => $self->all()))); }); }
public function render() { return Tart::form($this, function ($h, $self) { $h('label', __($self->label())); $h('p', function ($h, $self) { $h('div', array('class' => 'btn-group' . ($self->vertical() ? ' btn-group-vertical' : ''), 'data-toggle' => 'buttons-radio'), function ($h, $self) { if ($self->all()) { $h('a', array('class' => 'btn ' . ($self->parent()->form()->object()->{$self->name()} ? '' : ' active'), 'href' => Request::current()->url() . URL::query(array($self->name() => ''))), __('All')); } foreach ($self->params() as $value => $label) { $h('a', array('class' => 'btn ' . ($self->parent()->form()->object()->{$self->name()} == $value ? ' active' : ''), 'href' => Request::current()->url() . URL::query(array($self->name() => $value))), $label); } }); }); }); }