Overview

Namespaces

  • MvcCore
    • Ext
      • Auth
        • Virtual
      • Debug
        • Tracy
      • Form
        • Core
        • Validators
      • Request
      • Router
        • Lang
      • View
        • Helpers
  • None

Classes

  • Base
  • Configuration
  • Field
  • FieldGroup
  • Helpers
  • Validator
  • View

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree

Class FieldGroup

MvcCore\Ext\Form\Core\Field
Extended by MvcCore\Ext\Form\Core\FieldGroup

Direct known subclasses

MvcCore\Ext\Form\CheckboxGroup, MvcCore\Ext\Form\RadioGroup
Abstract
Namespace: MvcCore\Ext\Form\Core
Located at ext-form/src/MvcCore/Ext/Form/Core/FieldGroup.php
Methods summary
public
# SetOptions( array $options )

Set form group control options to render more values for more specified submitted keys. Examples:

Set form group control options to render more values for more specified submitted keys. Examples:

To configure radio buttons named: 'gender' for 'Female' and 'Male': use configuration: $field->SetId('gender') ->SetOptions(array( // field values will be translated if configured 'f' => 'Female', 'm' => 'Male', )); To configure radio buttons named: 'gender' for 'Female' and 'Male': use configuration: $field->SetId('gender') ->SetOptions(array( 'f' => array( 'text' => 'Female', // text keys will be translated if configured 'class' => 'female', 'attrs' => array('data-any' => 'female-values'), ), 'm' => array( 'text' => 'Male', // text keys will be translated if configured 'class' => 'male', 'attrs' => array('data-any' => 'male-values'), ), ));

Parameters

$options
public
# SetGroupCssClasses( $cssClasses )

Set css class(es) for group label, as array of strings or string with classes separated by space.

Set css class(es) for group label, as array of strings or string with classes separated by space.

Var

string|string[]
public
# AddGroupCssClass( $cssClasses )

Add css class(es) for group label, as array of strings or string with classes separated by space.

Add css class(es) for group label, as array of strings or string with classes separated by space.

Var

string|string[]
public
# SetGroupLabelAttrs( $attrs = array() )

Set any additional attributes for group label, defined as key (for attribute name) and value (for attribute value). Any previously defined attributes will be replaced.

Set any additional attributes for group label, defined as key (for attribute name) and value (for attribute value). Any previously defined attributes will be replaced.

Var

string[]
public
# AddGroupLabelAttr( $attr = array() )

Add any additional attributes for group label, defined as key (for attribute name) and value (for attribute value). All additional attributes will be completed as array merge with previous values and new values.

Add any additional attributes for group label, defined as key (for attribute name) and value (for attribute value). All additional attributes will be completed as array merge with previous values and new values.

Var

string[]
public
# OnAdded( MvcCore\Ext\Form & $form )

This method is called internaly from \MvcCore\Ext\Form after field is added into form by $form->AddField(); method. Do not use it if you are only user of this library. - check if there are any options for current controls group Parent method: - check if field has any name, which is required - set up form and field id attribute by form id and field name - set up required

This method is called internaly from \MvcCore\Ext\Form after field is added into form by $form->AddField(); method. Do not use it if you are only user of this library. - check if there are any options for current controls group Parent method: - check if field has any name, which is required - set up form and field id attribute by form id and field name - set up required

Parameters

$form

Throws

MvcCore\Ext\Form\Core\Exception

Overrides

MvcCore\Ext\Form\Core\Field::OnAdded()
public
# SetUp( )

Set up field properties before rendering process. - translate all option texts Parent method: - set up field render mode - set up translation boolean - translate label if any

Set up field properties before rendering process. - translate all option texts Parent method: - set up field render mode - set up translation boolean - translate label if any

Overrides

MvcCore\Ext\Form\Core\Field::SetUp()
public string
# RenderNaturally( )

Render field naturaly by render mode. Field shoud be rendered with label beside, label around or without label by local field configuration. Also there could be rendered specific field errors before or after field if field form is configured in that way.

Render field naturaly by render mode. Field shoud be rendered with label beside, label around or without label by local field configuration. Also there could be rendered specific field errors before or after field if field form is configured in that way.

Returns

string

Overrides

MvcCore\Ext\Form\Core\Field::RenderNaturally()
public string
# RenderControlInsideLabel( )

Render field control inside label by local configuration, render field errors beside if form is configured to render specific errors beside controls.

Render field control inside label by local configuration, render field errors beside if form is configured to render specific errors beside controls.

Returns

string

Overrides

MvcCore\Ext\Form\Core\Field::RenderControlInsideLabel()
public string
# RenderControl( )

Render all subcontrols by multiple calls of $field->RenderControlItem();

Render all subcontrols by multiple calls of $field->RenderControlItem();

Returns

string

Overrides

MvcCore\Ext\Form\Core\Field::RenderControl()
public string
# RenderLabel( )

Render label tag only without control or specific errors.

Render label tag only without control or specific errors.

Returns

string

Overrides

MvcCore\Ext\Form\Core\Field::RenderLabel()
public string
# RenderControlItem( $key, $option )

Render subcontrols with each subcontrol label tag and without group label or without group specific errors.

Render subcontrols with each subcontrol label tag and without group label or without group specific errors.

Returns

string
protected array
# renderControlItemCompleteAttrsClassesAndText( string $key, string|array $option )

Complete by $field->Options key and option value: - label text - label attributes string - control attributes string

Complete by $field->Options key and option value: - label text - label attributes string - control attributes string

Parameters

$key
$option

Returns

array
Methods inherited from MvcCore\Ext\Form\Core\Field
AddControlAttr(), AddCssClass(), AddError(), AddLabelAttr(), AddValidators(), GetValue(), Render(), RenderErrors(), RenderLabelAndControl(), RenderTemplate(), SetControlAttrs(), SetCss(), SetCssClasses(), SetDisabled(), SetJs(), SetJsClass(), SetLabel(), SetLabelAttrs(), SetLabelSide(), SetName(), SetReadonly(), SetRenderMode(), SetRequired(), SetTemplatePath(), SetTranslate(), SetType(), SetValidators(), SetValue(), __construct(), __set(), renderAttrsWithFieldVars(), renderControlAttrsWithFieldVars(), renderLabelAttrsWithFieldVars()
Properties summary
public string $Type

Form group pseudo control type, unique type accross all form field types.

Form group pseudo control type, unique type accross all form field types.

# ''
public array $Value

Form control value, always as array of string or numbers for group of controls.

Form control value, always as array of string or numbers for group of controls.

# array()
public array $Options

Form group control options to render more subcontrol attributes for specified submitted values (array keys). This property configuration is required. Examples:

Form group control options to render more subcontrol attributes for specified submitted values (array keys). This property configuration is required. Examples:

To configure radio buttons named: 'gender' for 'Female' and 'Male': use configuration: $field->Id = 'gender'; $field->Options = array( 'f' => 'Female', 'm' => 'Male', ); To configure radio buttons named: 'gender' for 'Female' and 'Male': use configuration: $field->Id = 'gender'; $field->Options = array( 'f' => array( 'text' => 'Female', 'class' => 'female', 'attrs' => array('data-any' => 'female-values'), ), 'm' => array( 'text' => 'Male', 'class' => 'male', 'attrs' => array('data-any' => 'male-values'), ), );

Requires

# array()
public string[] $GroupCssClasses

Css class for group label.

Css class for group label.

# array()
public string[] $GroupLabelAttrs

Any additional attributes for group label, defined as key (for attribute name) and value (for attribute value).

Any additional attributes for group label, defined as key (for attribute name) and value (for attribute value).

# array()
public static array|stdClass $Templates

Internal common templates how to render field group elements naturaly.

Internal common templates how to render field group elements naturaly.

# array( 'label' => '<label for="{id}"{attrs}>{label}</label>', 'control' => '<input id="{id}" name="{name}" type="{type}" value="{value}"{checked}{attrs} />', 'togetherLabelLeft' => '<label for="{id}"{attrs}><span>{label}</span>{control}</label>', 'togetherLabelRight'=> '<label for="{id}"{attrs}>{control}<span>{label}</span></label>', )
Properties inherited from MvcCore\Ext\Form\Core\Field
$ControlAttrs, $Css, $CssClasses, $Disabled, $Errors, $Form, $Id, $Js, $JsClass, $Label, $LabelAttrs, $LabelSide, $Name, $Readonly, $RenderMode, $Required, $TemplatePath, $Translate, $Validators, $View, $declaredProtectedProperties
MvcCore API documentation generated by ApiGen