/** * Create a Bootstrap radio input. * * @param string $name * @param string $label * @param string $value * @param boolean $checked * @param boolean $inline * @param boolean $wrapper * @param array $options * @return string */ public function radio($name, $label, $value, $checked = null, $inline = false, $options = array()) { $labelOptions = $inline ? array('class' => 'radio-inline') : array(); $inputElement = $this->form->radio($name, $value, $checked, $options); $labelElement = '<label ' . $this->html->attributes($labelOptions) . '>' . $inputElement . $label . '</label>'; return $inline ? $labelElement : '<div class="radio">' . $labelElement . '</div>'; }
public function radios($names, $value = 1, $checked = null, $options = array()) { $nameArray = explode(",", $names); $groupName = $nameArray[0]; $view = $this->form->label($groupName); array_shift($nameArray); foreach ($nameArray as $name) { $label = array_get($options, 'label', $this->translationDomain ? $this->translationDomain . '.' . $name : $name); unset($options['label']); $label = \Lang::get($label); $view = $view . '<div class="radio"><label>' . $this->form->radio($groupName, $value, $checked, $options) . $label . '</label></div>'; } return $view; }
/** * Create a radio button input field. * * @param string $name * @param mixed $value * @param bool $checked * @param array $options * @return string * @static */ public static function radio($name, $value = null, $checked = null, $options = array()) { return \Illuminate\Html\FormBuilder::radio($name, $value, $checked, $options); }
/** * Create a HTML radio input element. * * @param string $name * @param string $value * @param bool $checked * @param array $attributes * @return string */ public function radio($name, $value = '1', $checked = false, $attributes = array()) { $checked = $this->calculateValue($name, $checked, $value); $attributes = $this->setAttributes($name, $attributes, false); return parent::radio($name, $value, $checked, $attributes); }
/** * @param Field $field * @return string */ public function radioField(Field $field) { return $this->builder->radio($field->name, $field->value, $field->checked, $field->getAttributes()); }
/** * Create an inline radio button input field. * * @param string $name * @param mixed $value * @param mixed $label * @param bool $checked * @param array $options * * @return string */ public function inlineRadio($name, $value = null, $label = null, $checked = null, $options = []) { $checkable = parent::radio($name, $value, $checked, $options); return $this->wrapInlineCheckable($label, 'radio', $checkable); }
/** * Create a radio button input field. * * @param string $name * @param mixed $value * @param bool $checked * @param array $options * @return string */ public function radio($name, $value = null, $checked = null, $options = array()) { $this->appendReadOnly($options); return parent::radio($name, $value, $checked, $options); }