Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • A
  • Actions
  • Alert
  • AlterCSSClassNamesEvent
  • AssetsCollector
  • Button
  • CSSCollector
  • Dataset
  • Date
  • DateRange
  • DateTime
  • Decorator
  • Document
  • DropdownMenu
  • Element
  • File
  • Form
  • Group
  • Helpers
  • HTMLString
  • Iterator
  • JSCollector
  • ListView
  • ListViewColumn
  • Modal
  • Pager
  • Popover
  • PopoverWidget
  • Ranger
  • RecursiveIterator
  • Salutation
  • Searchbox
  • Section
  • SplitButton
  • Text
  • Widget

Interfaces

  • CSSClassNames
  • DecoratorInterface
  • HTMLStringInterface
  • Validator

Traits

  • CSSClassNamesProperty

Exceptions

  • ElementIsEmpty

Functions

  • _array_flatten_callback
  • array_flatten
  • array_insert
  • check_session
  • dump
  • escape
  • escape_all
  • format
  • format_size
  • get_accessible_file
  • get_document
  • normalize
  • render_css_class
  • render_exception
  • retrieve_form
  • retrieve_form_errors
  • shorten
  • stable_sort
  • store_form
  • store_form_errors
  • strip
  • t

Class Form

A <FORM> element.

ICanBoogie\Object implements ICanBoogie\ToArrayRecursive uses ICanBoogie\ToArrayRecursiveTrait, ICanBoogie\PrototypeTrait
Extended by Brickrouge\Element implements ArrayAccess, IteratorAggregate, Brickrouge\HTMLStringInterface
Extended by Brickrouge\Form implements Brickrouge\Validator

Direct known subclasses

Icybee\DeleteBlock, Icybee\Element\Form, Icybee\Modules\Users\Roles\ManageBlock, Icybee\Installer\PanelForm, Icybee\Modules\Comments\SubmitForm, Icybee\Modules\Forms\ContactForm, Icybee\Modules\Forms\PressContactForm, Icybee\Modules\Forms\QuickContactForm, Icybee\Modules\Nodes\ExportBlock, Icybee\Modules\Users\LoginForm, Icybee\Modules\Users\NonceLogin\NonceRequestForm

Indirect known subclasses

Icybee\Installer\DatabaseForm, Icybee\Installer\SiteForm, Icybee\Modules\Users\DeleteBlock, Icybee\Modules\Users\Roles\DeleteBlock, Icybee\Installer\UserForm, Icybee\Modules\Comments\DeleteBlock, Icybee\Modules\Contents\DeleteBlock, Icybee\Modules\Nodes\DeleteBlock, Icybee\Modules\Pages\ExportBlock, Icybee\Modules\Sites\DeleteBlock, Icybee\Modules\Taxonomy\Terms\DeleteBlock, Icybee\Modules\Taxonomy\Vocabulary\DeleteBlock

Namespace: Brickrouge
Located at vendor/brickrouge/brickrouge/lib/form.php

Methods summary

protected static string
# get_auto_name( )

Returns a unique form name.

Returns a unique form name.

Returns

string
public
# __construct( array $attributes = array() )

Default attributes are added to those provided using a union:

Default attributes are added to those provided using a union:

  • action: If the id attribute is provided, action is set to "#<id>".
  • method: "POST"
  • enctype: "multipart/form-data"
  • name: The value of the id attribute or a name generated with the Brickrouge\Form::get_auto_name() method

If method is different than "POST" then the enctype attribute is unset.

Parameters

$attributes
array
$attributes

See

Brickrouge\Element::__construct()

Overrides

Brickrouge\Element::__construct
public string
# __toString( )

Renders the object into an HTML string.

Renders the object into an HTML string.

Before rendering the object form elements are altered according to the Brickrouge\Form::VALUES and Brickrouge\Form::DISABLED tags and previous validation errors.

Returns

string
The HTML representation of the object

See

Brickrouge\Element::__toString()

Overrides

Brickrouge\Element::__toString
public
# offsetSet( string $offset, mixed $value )

Override the method to map the Brickrouge\Form::HIDDENS tag to the Brickrouge\Form::$hiddens property.

Override the method to map the Brickrouge\Form::HIDDENS tag to the Brickrouge\Form::$hiddens property.

Parameters

$offset
string
$attribute The attribute.
$value
mixed
$value The value of the attribute.

See

Brickrouge\Element::offsetSet()

Overrides

Brickrouge\Element::offsetSet
public RecursiveIteratorIterator
# getIterator( )

Returns a recursive iterator.

Returns a recursive iterator.

A Brickrouge\RecursiveIterator iterator is created to traverse the children of the form.

The recursive iterator is created with the SELF_FIRST mode.

Returns

RecursiveIteratorIterator

See

IteratorAggregate::getIterator()

Overrides

Brickrouge\Element::getIterator
public array
# __sleep( )

The method alters the Brickrouge\Form::$required, Brickrouge\Form::$validators and Brickrouge\Form::$validator properties required for the serialization.

The method alters the Brickrouge\Form::$required, Brickrouge\Form::$validators and Brickrouge\Form::$validator properties required for the serialization.

The following properties are exported: name, required, validators and validator.

Returns

array

Overrides

ICanBoogie\Object::__sleep
protected string
# render_children( array $children )

If a rendered is defined it is used to render the children.

If a rendered is defined it is used to render the children.

The rendered is defined using the Brickrouge\Form::RENDERER attribute.

Parameters

$children
array
$children

Returns

string

See

Brickrouge\Element::render_children()

Overrides

Brickrouge\Element::render_children
protected string|null
# render_inner_html( )

Add hidden input elements and log messages to the inner HTML of the element being converted to a string.

Add hidden input elements and log messages to the inner HTML of the element being converted to a string.

Returns

string|null
The content of the element. The element is to be considered _self-closing_ if null is returned.

See

Brickrouge\Element::render_inner_html()

Overrides

Brickrouge\Element::render_inner_html
protected string
# render_errors( string|ICanBoogie\Errors $errors )

Renders errors as an HTML element.

Renders errors as an HTML element.

An Brickrouge\Alert object is used to render the provided errors.

Parameters

$errors
string|ICanBoogie\Errors
$errors.

Returns

string
protected string
# render_actions( mixed $actions )

Renders actions using an Brickrouge\Actions element.

Renders actions using an Brickrouge\Actions element.

Parameters

$actions
mixed
$actions

Returns

string
Return the actions block.
protected string
# render_hiddens( array $hiddens )

Renders hidden values.

Renders hidden values.

Parameters

$hiddens
array
$hiddens

Returns

string
protected
# alter_elements( array $values, boolean $disabled, array|ICanBoogie\Errors $errors )

Alters the elements according to the state of the form.

Alters the elements according to the state of the form.

Parameters

$values
array
$values
$disabled
boolean
$disabled true if the form is disabled, false otherwise.
$errors
array|ICanBoogie\Errors
$errors The validation errors.
public string
# save( )

Save the form in the session for future validation.

Save the form in the session for future validation.

Returns

string
The key used to identify the form save in the session.
public static Brickrouge\Form
# load( mixed $key )

Loads a form previously saved in session.

Loads a form previously saved in session.

Parameters

$key
mixed
$string $key The key used to identify the form to load, or an array in which Brickrouge\Form::STORED_KEY_NAME defines the key.

Returns

Brickrouge\Form

Throws

Exception
if the form cannot be retrieved.
public static boolean
# exists( string $key )

Checks if a previously saved form exists for a given key.

Checks if a previously saved form exists for a given key.

Parameters

$key
string
$key The key used to identify the form.

Returns

boolean
Return true if the form exists.
public static
# select_element_label( mixed $element )
public boolean
# validate( mixed $values, ICanBoogie\Errors $errors )

Validates the form using the provided values.

Validates the form using the provided values.

Parameters

$values
mixed
$value
$errors
ICanBoogie\Errors
$errors

Returns

boolean
true if the validation succeed, false otherwise.

See

Brickrouge\Element::validate()

Overrides

Brickrouge\Element::validate

Implementation of

Brickrouge\Validator::validate()
protected
# validate_required_elements( array $required, array & $validators, array $values, ICanBoogie\Errors $errors )
public static
# validate_email( ICanBoogie\Errors $errors, mixed $element, mixed $value )
public static
# validate_url( ICanBoogie\Errors $errors, mixed $element, mixed $value )
public static
# validate_string( ICanBoogie\Errors $errors, mixed $element, mixed $value, mixed $rules )
public static
# validate_range( ICanBoogie\Errors $errors, mixed $element, mixed $value, mixed $rules )

Methods inherited from Brickrouge\Element

add_assets(), add_class(), adopt(), alter_attributes(), alter_class_names(), alter_dataset(), auto_element_id(), decorate(), decorate_with_description(), decorate_with_inline_help(), decorate_with_label(), decorate_with_legend(), get_attributes(), get_class(), get_dataset(), get_ordered_children(), handle_assets(), has_class(), lazy_get_id(), offsetExists(), offsetGet(), offsetUnset(), remove_class(), render(), render_attributes(), render_child(), render_class(), render_dataset(), render_inner_html_for_checkbox_group(), render_inner_html_for_radio_group(), render_inner_html_for_select(), render_inner_html_for_textarea(), render_outer_html(), set_class(), set_dataset()

Methods inherited from ICanBoogie\Object

from(), resolve_facade_properties(), resolve_private_properties(), to_array(), to_json()

Methods inherited from ICanBoogie\ToArrayRecursive

to_array_recursive()

Methods used from ICanBoogie\ToArrayRecursiveTrait

to_array_recursive()

Methods used from ICanBoogie\PrototypeTrait

__call(), __get(), __set(), __wakeup(), get_prototype(), has_method(), has_property(), last_chance_get(), last_chance_set()

Magic methods summary

Constants summary

boolean DISABLED '#form-disabled'
#

Set to true to disable all the elements of the form.

Set to true to disable all the elements of the form.

array[string]mixed HIDDENS '#form-hiddens'
#

Used to provide hidden values. Each key/value pair of the array is used to create an hidden input element with key as name attribute and value as value attribute.

Used to provide hidden values. Each key/value pair of the array is used to create an hidden input element with key as name attribute and value as value attribute.

string LABEL_COMPLEMENT '#form-label-complement'
#

Complement to the Brickrouge\Element::LABEL tag. Its layout depends on the form renderer.

Complement to the Brickrouge\Element::LABEL tag. Its layout depends on the form renderer.

boolean NO_LOG '#form-no-log'
#

If true possible alert messages are not displayed.

If true possible alert messages are not displayed.

array VALUES '#form-values'
#

Values for the elements of the form. The form recursively iterates through its children to set their values, if their values it not already set (e.g. non null).

Values for the elements of the form. The form recursively iterates through its children to set their values, if their values it not already set (e.g. non null).

string RENDERER '#form-renderer'
#

The class name of the renderer to use to render the children of the form. If no renderer is defined, children are simply concatenated.

The class name of the renderer to use to render the children of the form. If no renderer is defined, children are simply concatenated.

boolean|array|string ACTIONS '#form-actions'
#

Defines the actions of the form.

Defines the actions of the form.

See

Brickrouge\Form::render_actions()
string ERRORS '#form-errors'
#
string STORED_KEY_NAME '_brickrouge_form_key'
#

Constants inherited from Brickrouge\Element

CHILDREN, DEFAULT_VALUE, DESCRIPTION, GROUP, GROUPS, INLINE_HELP, INNER_HTML, LABEL, LABEL_MISSING, LABEL_POSITION, LEGEND, OPTIONS, OPTIONS_DISABLED, REQUIRED, STATE, TYPE_CHECKBOX, TYPE_CHECKBOX_GROUP, TYPE_RADIO, TYPE_RADIO_GROUP, VALIDATOR, VALIDATOR_OPTIONS, WEIGHT, WIDGET_CONSTRUCTOR

Properties summary

protected static integer $auto_name_index
#
public array[string]string $hiddens
#

Hidden values, initialized with the Brickrouge\Form::HIDDENS tag.

Hidden values, initialized with the Brickrouge\Form::HIDDENS tag.

public string $name
#

Name of the form.

Name of the form.

protected array[string]Element $required
#

The required elements of the form.

The required elements of the form.

protected array[string] $booleans
#

Booleans found in the form.

Booleans found in the form.

protected array[string]Element $validators
#

Elements of the form with a validator.

Elements of the form with a validator.

protected callable $validator
#

Validator callback of the form.

Validator callback of the form.

Properties inherited from Brickrouge\Element

$auto_element_id, $children, $class_names, $inner_html, $tag_name, $tags, $type

Magic properties inherited from Brickrouge\Element

$class, $dataset, $id

Magic properties inherited from ICanBoogie\Object

$prototype

Autodoc API documentation generated by ApiGen 2.8.0