PHP Class WPDKUIControl

[control label][control input][extra] In detail a WPDK ui control has the follow structure: [before] [before_label] [label control] [after_label] [prepend] [main control][extra] [append] [after] However every control class has its drawing method to manage different output. ## Overview This class allow to make simple display button and common UI.
Author: =undo= ([email protected])
Afficher le fichier Open project: wpxtreme/wpdk Class Usage Examples

Protected Properties

Свойство Type Description
$attrs array | string A string with list of attributes
$class string | array A string or an array with CSS classes
$data string | array A string or an array with list of data attributes
$id string A sanitize attribute id
$item array A key value pairs array with the WPDK ui control description
$name string The name attribute
$style string A string with inlibe CSS styles

Méthodes publiques

Méthode Description
__construct ( array $item_control ) Create an instance of WPDKUIControl class
display ( ) Display the control
draw ( ) Drawing
html ( ) : string Return the HTML markup for control

Méthodes protégées

Méthode Description
attrs ( ) : string Return a string with complete list of generic attributes as title, id, etc.
classes ( ) : string Return a string with complete list of CSS class
contentWithKey ( string $key ) : string Return the content by specific key. If the content is an instance of class WPDKUIControl then get the HTML.
data ( ) : string Return a string with complete list of data attributes as data-name = "value". For example:
guide ( ) : string Return the HTML markup for the guide engine
inputType ( string | WPDKHTMLTagInputType $type = WPDKHTMLTagInputType::TEXT, string $class = '' ) This is a utility method to display a common input type
label ( ) : null | WPDKHTMLTagLabel Return an instance of WPDKHTMLTagLabel class or null if no label provided.

Private Methods

Méthode Description
sizeForType ( string $type ) : integer Return the specific attribute size for control type

Method Details

__construct() public méthode

Create an instance of WPDKUIControl class
public __construct ( array $item_control )
$item_control array Control array

attrs() protected méthode

..
protected attrs ( ) : string
Résultat string

classes() protected méthode

Return a string with complete list of CSS class
protected classes ( ) : string
Résultat string

contentWithKey() protected méthode

If the content is an array (Controls Layout array) porcess it as sub-control.
protected contentWithKey ( string $key ) : string
$key string String key in array
Résultat string

data() protected méthode

The data asttributes are readable and writeable from jQuery with: $( 'div' ).data( 'my_attribute' );
protected data ( ) : string
Résultat string

display() public méthode

Display the control
public display ( )

draw() public méthode

Drawing
public draw ( )

guide() protected méthode

Return the HTML markup for the guide engine
Since: 1.0.0.b4
protected guide ( ) : string
Résultat string

html() public méthode

Return the HTML markup for control
public html ( ) : string
Résultat string

inputType() protected méthode

This is a utility method to display a common input type
protected inputType ( string | WPDKHTMLTagInputType $type = WPDKHTMLTagInputType::TEXT, string $class = '' )
$type string | WPDKHTMLTagInputType Optional. Type of input
$class string Optional. CSS additional class

label() protected méthode

Return an instance of WPDKHTMLTagLabel class or null if no label provided.
protected label ( ) : null | WPDKHTMLTagLabel
Résultat null | WPDKHTMLTagLabel

Property Details

$attrs protected_oe property

A string with list of attributes
protected array|string $attrs
Résultat array | string

$class protected_oe property

A string or an array with CSS classes
protected string|array $class
Résultat string | array

$data protected_oe property

A string or an array with list of data attributes
protected string|array $data
Résultat string | array

$id protected_oe property

A sanitize attribute id
protected string $id
Résultat string

$item protected_oe property

A key value pairs array with the WPDK ui control description
protected array $item
Résultat array

$name protected_oe property

The name attribute
protected string $name
Résultat string

$style protected_oe property

A string with inlibe CSS styles
protected string $style
Résultat string