PHP Class Former\Form\Group

Inheritance: extends HtmlObject\Traits\Tag
Afficher le fichier Open project: anahkiasen/former Class Usage Examples

Méthodes publiques

Свойство Type Description
$openGroup Former\Form\Group The custom group that is open
$opened boolean Whether a custom group is opened or not

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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

__toString() public méthode

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

addGroupClass() public méthode

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

append() public méthode

Append elements to the field
public append ( )

appendIcon() public méthode

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 méthode

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

contents() public méthode

Set the contents of the current group
public contents ( string $contents ) : string
$contents string The group contents
Résultat string A group

getErrors() public méthode

Get the errors for the group
public getErrors ( ) : string
Résultat string

getFormattedLabel() public méthode

Get the formatted group label
public getFormattedLabel ( ) : string | null
Résultat string | null

getHelp() protected méthode

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

getLabel() protected méthode

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

help() public méthode

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

inlineHelp() public méthode

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

isRaw() public méthode

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

open() public méthode

Opens a group
public open ( ) : string
Résultat string Opening tag

placeAround() protected méthode

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 méthode

Prepend elements to the field
public prepend ( )

prependAppend() protected méthode

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

prependIcon() public méthode

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 méthode

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

setLabel() public méthode

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

state() public méthode

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

wrap() public méthode

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

wrapField() public méthode

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

Property Details

$app protected_oe property

The Container
protected Container,Illuminate\Container $app
Résultat Illuminate\Container\Container

$append protected_oe property

An array of elements to append the field
protected array $append
Résultat array

$element protected_oe property

The group's element
protected string $element
Résultat string

$help protected_oe property

The group help
protected array $help
Résultat array

$label protected_oe property

The group label
protected Element,HtmlObject $label
Résultat HtmlObject\Element

$openGroup public_oe static_oe property

The custom group that is open
public static Former\Form\Group $openGroup
Résultat Former\Form\Group

$opened public_oe static_oe property

Whether a custom group is opened or not
public static bool $opened
Résultat boolean

$prepend protected_oe property

An array of elements to preprend the field
protected array $prepend
Résultat array

$raw protected_oe property

Whether the field should be displayed raw or not
protected bool $raw
Résultat boolean

$state protected_oe property

The current state of the group
protected string $state
Résultat string

$validations protected_oe property

The field validations to be checked for errors
protected array $validations
Résultat array