PHP Класс 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.
Автор: =undo= ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__construct ( array $item_control ) Create an instance of WPDKUIControl class
display ( ) Display the control
draw ( ) Drawing
html ( ) : string Return the HTML markup for control

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
sizeForType ( string $type ) : integer Return the specific attribute size for control type

Описание методов

__construct() публичный Метод

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

attrs() защищенный Метод

..
protected attrs ( ) : string
Результат string

classes() защищенный Метод

Return a string with complete list of CSS class
protected classes ( ) : string
Результат string

contentWithKey() защищенный Метод

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
Результат string

data() защищенный Метод

The data asttributes are readable and writeable from jQuery with: $( 'div' ).data( 'my_attribute' );
protected data ( ) : string
Результат string

display() публичный Метод

Display the control
public display ( )

draw() публичный Метод

Drawing
public draw ( )

guide() защищенный Метод

Return the HTML markup for the guide engine
С версии: 1.0.0.b4
protected guide ( ) : string
Результат string

html() публичный Метод

Return the HTML markup for control
public html ( ) : string
Результат string

inputType() защищенный Метод

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() защищенный Метод

Return an instance of WPDKHTMLTagLabel class or null if no label provided.
protected label ( ) : null | WPDKHTMLTagLabel
Результат null | WPDKHTMLTagLabel

Описание свойств

$attrs защищенное свойство

A string with list of attributes
protected array|string $attrs
Результат array | string

$class защищенное свойство

A string or an array with CSS classes
protected string|array $class
Результат string | array

$data защищенное свойство

A string or an array with list of data attributes
protected string|array $data
Результат string | array

$id защищенное свойство

A sanitize attribute id
protected string $id
Результат string

$item защищенное свойство

A key value pairs array with the WPDK ui control description
protected array $item
Результат array

$name защищенное свойство

The name attribute
protected string $name
Результат string

$style защищенное свойство

A string with inlibe CSS styles
protected string $style
Результат string