PHP Класс WPDKConfigurationView

## Overview You can subclass this class to build an easy view config. This class help you to render a standard view for the configuration panel. It create for you the wrap HTML content, dispplay the form fields and update or reset the data. In addition display the message for feedback. ### Implement method You can implement some standard method for manage this view * fields() This method return an SDF array to display the form fields * content() This method is used for custom view control. Overwrite the fields() * save() Your own custom save data. If this method id not implement your data aren't saved.
Устаревший: since 1.2.0 Use WPDKPreferencesViewController and WPDKPreferencesView instead
Автор: =undo= ([email protected])
Наследование: extends WPDKView
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$introduction string This is an optional string information
$title string The configuration title

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

Метод Описание
__construct ( string $id, string $title, WPDKConfiguration $configuration = null, object | array $sub_configuration = null, string $introduction = '' ) : WPDKConfigurationView Create WPDKConfigurationView instance object
buttonsUpdateReset ( ) : string Return the HTML markup for standard [Reset to default] and [Update] buttons. You can override this method to hide or change the default buttons on bottom form.
draw ( ) Display the content view with form, introduction, fields or custom content. You can override this method with your own drawing.
fields ( ) Return a SDF array for build the form fields
resetToDefault ( ) Reset to default values of sub configuration branch. You can override this method if your sub configuration branch is not an object or not implements a defaults() method.
updatePostData ( ) : boolean Process and set you own post data
wpdk_header_view_after_title ( WPDKHeaderView $header_view ) Display succefully configuration updated message

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

Метод Описание
_introduction ( ) : string Return the introduction string, if exists, for HTML output
_processPost ( ) Update or reset configuration

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

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

Create WPDKConfigurationView instance object
public __construct ( string $id, string $title, WPDKConfiguration $configuration = null, object | array $sub_configuration = null, string $introduction = '' ) : WPDKConfigurationView
$id string ID key of configuration
$title string Title of configuration view
$configuration WPDKConfiguration Optional. Main configuration pointer
$sub_configuration object | array Optional. Sub configuration
$introduction string Optional. An introduction text message
Результат WPDKConfigurationView

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

Return the HTML markup for standard [Reset to default] and [Update] buttons. You can override this method to hide or change the default buttons on bottom form.
С версии: 1.0.0.b3
public buttonsUpdateReset ( ) : string
Результат string

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

Display the content view with form, introduction, fields or custom content. You can override this method with your own drawing.
public draw ( )

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

Return a SDF array for build the form fields
public fields ( )

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

Reset to default values of sub configuration branch. You can override this method if your sub configuration branch is not an object or not implements a defaults() method.
public resetToDefault ( )

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

Process and set you own post data
public updatePostData ( ) : boolean
Результат boolean TRUE to update the configuration and display the standard sucessfully message, or FALSE to avoid the update configuration and do a custom display.

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

Display succefully configuration updated message
public wpdk_header_view_after_title ( WPDKHeaderView $header_view )
$header_view WPDKHeaderView

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

$introduction публичное свойство

This is an optional string information
public string $introduction
Результат string

$title публичное свойство

The configuration title
public string $title
Результат string