PHP Class Former\Form\Group

Inheritance: extends HtmlObject\Traits\Tag
显示文件 Open project: anahkiasen/former Class Usage Examples

Public Properties

Property Type Description
$openGroup Former\Form\Group The custom group that is open
$opened boolean Whether a custom group is opened or not

Protected Properties

Property Type Description
$app Illuminate\Container\Container The Container
$append array An array of elements to append the field
$element string The group's element
$help array The group help
$label HtmlObject\Element The group label
$prepend array An array of elements to preprend the field
$raw boolean Whether the field should be displayed raw or not
$state string The current state of the group
$validations array The field validations to be checked for errors

Public Methods

Method Description
__construct ( Illuminate\Container\Container $app, string $label, $validations = null ) Creates a group
__toString ( ) : string Prints out the opening of the Control Group
addGroupClass ( string $class ) Set a class on the Group
append ( ) Append elements to the field
appendIcon ( string $icon, array $attributes = [], $iconSettings = [] ) Append an icon to a field
blockHelp ( string $help, array $attributes = [] ) Add an block help
contents ( string $contents ) : string Set the contents of the current group
getErrors ( ) : string Get the errors for the group
getFormattedLabel ( ) : string | null Get the formatted group label
help ( string $help, array $attributes = [] ) Alias for inlineHelp
inlineHelp ( string $help, array $attributes = [] ) Add an inline help
isRaw ( ) : boolean Check if the current group is to be displayed or not
open ( ) : string Opens a group
prepend ( ) Prepend elements to the field
prependIcon ( string $icon, array $attributes = [], $iconSettings = [] ) Prepends an icon to a field
raw ( ) Disables the control group for the current field
setLabel ( string $label ) Adds a label to the group
state ( string $state ) Set the state of the group
wrap ( string $contents, string $label = null ) : string Wraps content in a group
wrapField ( Field $field ) : string Wrap a Field with the current group

Protected Methods

Method Description
getHelp ( ) : string Prints out the current help
getLabel ( string $field = null ) : string Prints out the current label
placeAround ( array $items, string $place ) Place elements around the field
prependAppend ( Field $field ) : string Format the field with prepended/appended elements

Method Details

__construct() public method

Creates a group
public __construct ( Illuminate\Container\Container $app, string $label, $validations = null )
$app Illuminate\Container\Container
$label string Its label

__toString() public method

Prints out the opening of the Control Group
public __toString ( ) : string
return string A control group opening tag

addGroupClass() public method

Set a class on the Group
public addGroupClass ( string $class )
$class string The class to add

append() public method

Append elements to the field
public append ( )

appendIcon() public method

Append an icon to a field
public appendIcon ( string $icon, array $attributes = [], $iconSettings = [] )
$icon string The icon to prepend
$attributes array Its attributes

blockHelp() public method

Add an block help
public blockHelp ( string $help, array $attributes = [] )
$help string The help text
$attributes array Facultative attributes

contents() public method

Set the contents of the current group
public contents ( string $contents ) : string
$contents string The group contents
return string A group

getErrors() public method

Get the errors for the group
public getErrors ( ) : string
return string

getFormattedLabel() public method

Get the formatted group label
public getFormattedLabel ( ) : string | null
return string | null

getHelp() protected method

Prints out the current help
protected getHelp ( ) : string
return string A .help-block or .help-inline

getLabel() protected method

Prints out the current label
protected getLabel ( string $field = null ) : string
$field string The field to create a label for
return string A

help() public method

Alias for inlineHelp
public help ( string $help, array $attributes = [] )
$help string The help text
$attributes array Facultative attributes

inlineHelp() public method

Add an inline help
public inlineHelp ( string $help, array $attributes = [] )
$help string The help text
$attributes array Facultative attributes

isRaw() public method

Check if the current group is to be displayed or not
public isRaw ( ) : boolean
return boolean

open() public method

Opens a group
public open ( ) : string
return string Opening tag

placeAround() protected method

Place elements around the field
protected placeAround ( array $items, string $place )
$items array An array of items to place
$place string Where they should end up (prepend|append)

prepend() public method

Prepend elements to the field
public prepend ( )

prependAppend() protected method

Format the field with prepended/appended elements
protected prependAppend ( Field $field ) : string
$field Field The field to format
return string Field plus supplementary elements

prependIcon() public method

Prepends an icon to a field
public prependIcon ( string $icon, array $attributes = [], $iconSettings = [] )
$icon string The icon to prepend
$attributes array Its attributes

raw() public method

Disables the control group for the current field
public raw ( )

setLabel() public method

Adds a label to the group
public setLabel ( string $label )
$label string A label

state() public method

Set the state of the group
public state ( string $state )
$state string A Bootstrap state class

wrap() public method

Wraps content in a group
public wrap ( string $contents, string $label = null ) : string
$contents string The content
$label string The label to add
return string A group

wrapField() public method

Wrap a Field with the current group
public wrapField ( Field $field ) : string
$field Former\Traits\Field A Field instance
return string A group

Property Details

$app protected_oe property

The Container
protected Container,Illuminate\Container $app
return Illuminate\Container\Container

$append protected_oe property

An array of elements to append the field
protected array $append
return array

$element protected_oe property

The group's element
protected string $element
return string

$help protected_oe property

The group help
protected array $help
return array

$label protected_oe property

The group label
protected Element,HtmlObject $label
return HtmlObject\Element

$openGroup public_oe static_oe property

The custom group that is open
public static Former\Form\Group $openGroup
return Former\Form\Group

$opened public_oe static_oe property

Whether a custom group is opened or not
public static bool $opened
return boolean

$prepend protected_oe property

An array of elements to preprend the field
protected array $prepend
return array

$raw protected_oe property

Whether the field should be displayed raw or not
protected bool $raw
return boolean

$state protected_oe property

The current state of the group
protected string $state
return string

$validations protected_oe property

The field validations to be checked for errors
protected array $validations
return array