本文整理汇总了PHP中Collective\Html\FormBuilder::input方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::input方法的具体用法?PHP FormBuilder::input怎么用?PHP FormBuilder::input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collective\Html\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::input方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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, []));
}
示例2: file
/**
* Create a Boostrap file upload button.
*
* @param string $name
* @param string $label
* @param array $options
* @return string
*/
public function file($name, $label = null, array $options = [], $extra = null)
{
$label = $this->getLabelTitle($label, $name);
$options = array_merge(['class' => 'filestyle', 'data-buttonBefore' => 'true'], $options);
$options = $this->getFieldOptions($options, $name);
$inputElement = $this->form->input('file', $name, null, $options);
$wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
$wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
return $this->getFormGroupWithLabel($name, $label, $wrapperElement, $extra);
}
示例3: file
/**
* Create a Boostrap file upload button.
*
* @param string $name
* @param string $label
* @param array $options
* @return string
*/
public function file($name, $label = null, array $options = [])
{
$label = $this->getLabelTitle($label, $name);
$options = array_merge(['class' => 'filestyle', 'data-buttonBefore' => 'true'], $options);
$options = $this->getFieldOptions($options);
$wrapperOptions = [];
if ($this->getType() === Type::HORIZONTAL) {
$wrapperOptions = ['class' => $this->getRightColumnClass()];
}
$inputElement = $this->form->input('file', $name, null, $options);
$groupElement = '<div ' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . '</div>';
return $this->getFormGroupWithLabel($name, $label, $groupElement);
}
示例4: buildControl
/**
* Build all control with the css class, label, and input.
*
* @param $type
* @param $name
* @param null $value
* @param array $attributes
* @param array $options
* @return string
*/
public function buildControl($type, $name, $value = null, $attributes = [], $options = [])
{
switch ($type) {
case 'select':
$options = ['' => config('field-builder.select')] + $options;
return $this->form->select($name, $options, $value, $attributes);
case 'password':
return $this->form->password($name, $attributes);
case 'checkbox':
return $this->form->checkbox($name, $value, isset($attributes['checked']), $attributes);
case 'textarea':
return $this->form->textarea($name, $value, $attributes);
case 'number':
return $this->form->number($name, $value, $attributes);
case 'radio':
return $this->form->radio($name, $value, $attributes);
case 'email':
return $this->form->email($name, $value, $attributes);
default:
return $this->form->input($type, $name, $value, $attributes);
}
}
示例5: input
/**
* Create a form input field.
*
* @param string $type
* @param string $name
* @param string $value
* @param array $options
* @return string
* @static
*/
public static function input($type, $name, $value = null, $options = array())
{
return \Collective\Html\FormBuilder::input($type, $name, $value, $options);
}
示例6: checkable
/**
* Create a checkable input field.
*
* @param string $type
* @param string $name
* @param mixed $value
* @param bool $checked
* @param array $options
*
* @return string
*/
protected function checkable($type, $name, $value, $checked, $options)
{
$checked = $this->getCheckedState($type, $name, $value, $checked);
if ($checked) {
$options['checked'] = 'checked';
}
return parent::input($type, $name, $value, $options);
}
示例7: input
/**
* Create a form input field.
*
* @param string $type
* @param string $name
* @param string $value
* @param array $options
* @return string
*/
public function input($type, $name, $value = null, $options = [])
{
return parent::input($type, $name, $value, $this->appendErrors($name, $options));
}
示例8: input
/**
* @see Collective\Html\FormBuilder
*/
public function input($type, $name, $value = null, $options = [])
{
$options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
return parent::input($type, $name, $value, $options);
}
示例9: inputSet
public function inputSet($type, $name, $value = null, $options = [], $customInput = null)
{
$options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
$labelText = isset($options['label']) ? $options['label'] : null;
$requiredLabel = isset($options['data-rule-required']) ? self::$requiredLabel : '';
$label = self::label($name, $labelText, [], $requiredLabel);
$input = isset($customInput) ? $customInput : parent::input($type, $name, $value, $options);
return self::makeSet($label, $input);
}
示例10: color
/**
* Creates a color element
*
* @param string $name The name of the element
* @param null $value
* @param array $attributes
* @return string
*/
public function color($name, $value = null, $attributes = array())
{
$attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
return parent::input('color', $name, $value, $attributes);
}