本文整理汇总了PHP中Collective\Html\FormBuilder::label方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::label方法的具体用法?PHP FormBuilder::label怎么用?PHP FormBuilder::label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collective\Html\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::label方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: textfield
public function textfield($name, $label, $errors, $labelOptions = array(), $inputOptions = array())
{
$labelOptions['class'] = 'form-label';
$inputOptions['class'] = 'form-control';
$inputOptions['placeholder'] = $label;
return sprintf('<div class="form-group">%s<div%s>%s%s</div></div><!-- end form-group -->', parent::label($name, $label, $labelOptions), $errors->has($name) ? ' class="error-control"' : '', parent::text($name, null, $inputOptions), $errors->has($name) ? '<span class="error"><label class="error" for="' . $name . '">' . $errors->first($name) . '</label></span>' : '');
}
示例2: getFormGroupPassword
public function getFormGroupPassword($label, $id, $value, $errors)
{
$feedBackSelector = $this->getFeedBackSelector($errors, $id);
$feedBackHtml = $this->getFeedBackHtml($errors, $id);
$retval = "<div class=\"form-group " . $feedBackSelector . "\">\n " . parent::label('' . $id . '', '' . $label . ':', ['class' => 'control-label']) . "\n " . parent::password('' . $id . '', ['class' => 'form-control']) . "\n " . $feedBackHtml . "\n </div>";
return $retval;
}
示例3: commonInputs
private function commonInputs($type, $name, $value = null, $options = [])
{
return sprintf('
<div class="input-field col l6 s8 offset-l3 offset-s2">
%s
%s
</div>', parent::input($type, $name, $value, $options), parent::label($name, null, []));
}
示例4: textarea
public function textarea($name, $value = null, $options = [])
{
return sprintf('
<div class="input-field col l6 s8 offset-l3 offset-s2">
%s
%s
</div>', parent::textarea($name, $value, ['class' => 'materialize-textarea']), parent::label($name, null, []));
}
示例5: wrapField
protected function wrapField($field, $labelName, $fieldOptions)
{
$labelText = isset($fieldOptions['label']) ? $fieldOptions['label'] : null;
//making sure that we match field's ID even when it is custom
$labelName = isset($field['id']) ? $fieldOptions['id'] : $labelName;
return sprintf('
<div class="input-field col l3 m4 s8 offset-l2 offset-m1 offset-s2">
%s
%s
</div>', $field, parent::label($labelName, $labelText, []));
}
示例6: registerFormTextField
private function registerFormTextField()
{
FormBuilder::macro('textField', function ($type, $name, $errors, $label, $labelOptions = array(), $inputOptions = array(), $inputClass) {
$valeur = \Request::old($name) ? \Request::old($name) : null;
$inputOptions['class'] = 'form-control';
return sprintf('
<div class="form-group">
%s
<div class="' . $inputClass . '">
%s
</div>
</div>', FormBuilder::label($name, $label, $labelOptions), $type == 'email' ? FormBuilder::email($name, $valeur, $inputOptions) : FormBuilder::text($name, $valeur, $inputOptions), $errors->first($name, '<small class="help-block">:message</small>'));
});
}
示例7: label
/**
* Create a form label element.
*
* @param string $name
* @param string $value
* @param array $options
* @return string
* @static
*/
public static function label($name, $value = null, $options = array())
{
return \Collective\Html\FormBuilder::label($name, $value, $options);
}
示例8: label
/**
* Create a Bootstrap label.
*
* @param string $name
* @param string $value
* @param array $options
*
* @return string
*/
public function label($name, $value = null, array $options = [])
{
$options = $this->getLabelOptions($options);
return $this->form->label($name, $value, $options);
}
示例9: label
/**
* Create a form label element.
*
* @param string $name
* @param string $value
* @param array $options
* @return string
*/
public function label($name, $value = null, $options = [])
{
return parent::label($name, $value, $this->appendErrors($name, $options));
}
示例10: label
/**
* Create a form label element.
*
* @param string $name
* @param string $value
* @param array $options
* @param bool $escape_html
*
* @return \Illuminate\Support\HtmlString
* @static
*/
public static function label($name, $value = null, $options = array(), $escape_html = true)
{
return \Collective\Html\FormBuilder::label($name, $value, $options, $escape_html);
}
示例11: label
public function label($name, $label = null, $options = [], $escapeHtml = true)
{
$label = array_pull($options, 'label') ?? $label ?? '';
$options = $this->setLabelOptionClasses($options);
return parent::label($name, $label, $options, $escapeHtml);
}
示例12: label
/**
* {@inheritdoc}
* @param string $name The name of the object this label will be
* attached to
* @param string|null $value The text of the label
* @param array $options The options of the label
* @return string
*/
public function label($name, $value = null, $options = array(), $valueHtml = false)
{
$options['class'] = isset($options['class']) ? self::LABEL . ' ' . $options['class'] : self::LABEL;
return parent::label($name, $value, $options, $valueHtml);
}
示例13: label
/**
* Create a label.
*
* @param string $name
* @param string $value
* @param array $options
*
* @return string
*/
public function label($name, $value = null, $options = [], $escape_html = true)
{
$this->addErrorClass($name, $options);
return parent::label($name, $value, $options);
}