PHP Class WPDKUI

## Overview This class allow to make simple display button and common UI.
Author: =undo= ([email protected])
Exibir arquivo Open project: wpxtreme/wpdk Class Usage Examples

Public Methods

Method Description
badge ( integer $count, string $classes = '', string $tooltip = '', string $placement = '' ) : string Return the HTML markup for a simple badge.
badged ( $count, $classes = '', $tooltip = '', $placement = '' )
button ( string $label = '', array $args = [] ) : string Return HTML markup for a input type
buttonsUpdateReset ( ) Return the HTML markup for standard [Update] and [Reset to default] button
inputNonce ( string $id ) : string Return the HTML markup for an input type hidden with a nonce value.
labelTruncate ( string $value, string $size = 'small' ) : string Return a new truncate well string. The result string is wrap into a special HTML markup.
submit ( array $args = [] ) : string Utility that return the HTML markup for a submit button
view ( string $id, string $title, string $icon_class, string $content ) : string Return a standard HTML markup view for WordPress backend, with wrap, icon, title and main container

Method Details

badge() public static method

Return the HTML markup for a simple badge.
public static badge ( integer $count, string $classes = '', string $tooltip = '', string $placement = '' ) : string
$count integer Optional. Number to display in the badge
$classes string Optional. Additional class for this badge
$tooltip string Optional. Tooltip to display when mouse over
$placement string Optional. Tooltip placement, default `bottom`
return string

badged() public static method

Deprecation: Since 1.0.0.b3 use badge() instead
public static badged ( $count, $classes = '', $tooltip = '', $placement = '' )

button() public static method

Return HTML markup for a input type
public static button ( string $label = '', array $args = [] ) : string
$label string Optional. Button label. If empty default is 'Update'
$args array Optional. A keys value array for additional settings 'type' => 'submit', 'name' => 'button-update', 'classes' => ' button-primary', 'additional_classes' => '', 'data' => ''
return string HTML input type submit

buttonsUpdateReset() public static method

Return the HTML markup for standard [Update] and [Reset to default] button
public static buttonsUpdateReset ( )

inputNonce() public static method

Return the HTML markup for an input type hidden with a nonce value.
Since: 1.0.0.b4
public static inputNonce ( string $id ) : string
$id string ID used for nonce code
return string

labelTruncate() public static method

Return a new truncate well string. The result string is wrap into a special HTML markup.
public static labelTruncate ( string $value, string $size = 'small' ) : string
$value string String to truncate
$size string Number of character
return string

submit() public static method

Utility that return the HTML markup for a submit button
public static submit ( array $args = [] ) : string
$args array Optional. Item description
return string

view() public static method

Return a standard HTML markup view for WordPress backend, with wrap, icon, title and main container
Deprecation: Use WPDKView and WPDKViewController
public static view ( string $id, string $title, string $icon_class, string $content ) : string
$id string Class to add to main content container
$title string Head title
$icon_class string Icon class
$content string HTML content
return string