本文整理汇总了PHP中Collective\Html\FormBuilder::text方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::text方法的具体用法?PHP FormBuilder::text怎么用?PHP FormBuilder::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collective\Html\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::text方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getFormGroupText
/**
* Create a submit button with default classes
*
* @param null $value
* @param array $options
* @return string
*/
public function getFormGroupText($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::text('' . $id . '', $value, ['class' => 'form-control']) . "\n " . $feedBackHtml . "\n </div>";
return $retval;
}
示例3: text
public function text($name, $value = null, $options = [])
{
return sprintf('
<div class="input-field col l6 s8 offset-l3 offset-s2">
%s
%s
</div>', parent::text($name, $value, $options), parent::label($name, null, []));
}
示例4: 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>'));
});
}
示例5: text
/**
* Create a text input field.
*
* @param string $name
* @param string $value
* @param array $options
* @return string
* @static
*/
public static function text($name, $value = null, $options = array())
{
return \Collective\Html\FormBuilder::text($name, $value, $options);
}
示例6: wrappedText
/**
* @param $name
* @param $labelText
* @param null $value
* @param array $options
* @return string
*/
public function wrappedText($name, $labelText, $value = null, $options = [])
{
return $this->wrapWithLabel($name, $labelText, $options, parent::text($name, $value, $this->appendErrors($name, $options)));
}
示例7: postalcode
public function postalcode($name, $value = null, $options = [])
{
if (isset($options['class'])) {
$options['class'] .= ' postalcodeNL';
} else {
$options['class'] = 'postalcodeNL';
}
$options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
return parent::text($name, $value, $options);
}
示例8: text
public function text($name, $value = null, $options = [])
{
$options = $this->setOptionClasses($name, $options, ['form-control']);
$controlOptions = array_filter($options, function ($key) {
return $key !== 'label';
}, ARRAY_FILTER_USE_KEY);
$controlHtml = parent::text($name, $value, $controlOptions);
return $this->renderControl('text', $controlHtml, $name, $value, $options);
}
示例9: text
/**
* {@inheritdoc}
* @param string $name The name of the text input
* @param string|null $value The default value
* @param array $attributes The attributes of the input
* @return string
*/
public function text($name, $value = null, $attributes = array())
{
$attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
return parent::text($name, $value, $attributes);
}
示例10: text
/**
* Create a text input field.
*
* @param string $name
* @param string $value
* @param array $options
*
* @return string
*/
public function text($name, $value = null, $options = [])
{
$this->addErrorClass($name, $options);
$tags['input'] = parent::text($name, $value, $options);
$tags['error'] = $this->getErrorTag($name);
return $this->buildTags($tags);
}
示例11: old
$addon .= '<span class="fa fa-' . $content . '"></span>';
$addon .= "</span>";
$element = Form::text($name, $value ? $value : old($name), field_attributes($name, $attributes));
$out = '<div class="input-group">';
$out .= $end ? '' : $addon;
$out .= $element;
$out .= $end ? $addon : '';
$out .= '</div>';
return field_wrapper($name, $label, $out);
});
Form::macro('textFieldIconClean', function ($name, $label = NULL, $content = 'pencil', $end = false, array $attributes = [], $value = NULL) {
$addon = '<span class="input-group-addon">';
$addon .= '<span class="fa fa-' . $content . '"></span>';
$addon .= "</span>";
$attributes = array_merge($attributes, ['placeholder' => $label]);
$element = Form::text($name, $value ? $value : old($name), field_attributes($name, $attributes));
$out = '<div class="input-group">';
$out .= $end ? '' : $addon;
$out .= $element;
$out .= $end ? $addon : '';
$out .= '</div>';
return field_wrapper($name, $out, '');
});
Form::macro('emailFieldIcon', function ($name, $label, $content = 'envelope', $end = false, array $attributes = [], $value = NULL) {
$addon = '<span class="input-group-addon">';
$addon .= '<span class="fa fa-' . $content . '"></span>';
$addon .= "</span>";
$element = Form::email($name, $value ? $value : old($name), field_attributes($name, $attributes));
$out = '<div class="input-group">';
$out .= $end ? '' : $addon;
$out .= $element;