本文整理汇总了PHP中Illuminate\Html\FormBuilder::radio方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::radio方法的具体用法?PHP FormBuilder::radio怎么用?PHP FormBuilder::radio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Html\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::radio方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: radio
/**
* 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>';
}
示例2: radios
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;
}
示例3: radio
/**
* 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);
}
示例4: radio
/**
* 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);
}
示例5: radioField
/**
* @param Field $field
* @return string
*/
public function radioField(Field $field)
{
return $this->builder->radio($field->name, $field->value, $field->checked, $field->getAttributes());
}
示例6: inlineRadio
/**
* 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);
}
示例7: radio
/**
* 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);
}