PHP Class WPDKViewController

## Overview A view controller to allow to manage a standard WordPress view. A standard view is: [ header with icon and title - optional button add] [single or more view] ### Subclassing notes
Author: =undo= ([email protected])
Inheritance: extends WPDKObject
显示文件 Open project: wpxtreme/wpdk Class Usage Examples

Public Properties

Property Type Description
$__version string Override version
$id string The unique id for this view controller
$title string The title of this view controller. This is displayed on top header
$view WPDKView The view stored in this property represents the root view for the view controller hierarchy.
$viewHead WPDKHeaderView An instance of WPDKHeaderView

Public Methods

Method Description
__construct ( string $id, string $title ) : WPDKViewController Create an instance of WPDKViewController class
_admin_head ( ) This method is called when the head of this view controller is loaded by WordPress.
admin_head ( ) This method is called when the head of this view controller is loaded by WordPress.
admin_print_styles ( ) Fires when styles are printed for a specific admin page based on $hook_suffix.
didHeadLoad ( ) This static method is called when the head of this view controller is loaded by WordPress.
display ( ) Display the content of this view controller
html ( ) : string Return the HTML markup content of this view
initWithView ( string $id, string $title, WPDKView $view ) : boolean | WPDKViewController Return an instance of WPDKViewController class. This static method create a view controller with a view.
load ( ) This method is called when the head of this view controller is loaded by WordPress.
willLoad ( ) This static method is called when the head of this view controller is loaded by WordPress.

Method Details

__construct() public method

Create an instance of WPDKViewController class
public __construct ( string $id, string $title ) : WPDKViewController
$id string The unique id for this view controller
$title string The title of this view controller. This is displayed on top header
return WPDKViewController

_admin_head() public method

It is used by WPDKMenu for example, as 'admin_head-' action. Internal view controller use this method to auto-load components. See for example WPDKPreferencesViewController
Since: 1.4.21
public _admin_head ( )

admin_head() public method

It is used by WPDKMenu for example, as 'admin_head-' action.
Since: 1.4.18
public admin_head ( )

admin_print_styles() public method

Fires when styles are printed for a specific admin page based on $hook_suffix.
Since: 1.6.0
public admin_print_styles ( )

didHeadLoad() public static method

It is used by WPDKMenu for example, as 'admin_head-' action.
public static didHeadLoad ( )

display() public method

Display the content of this view controller
public display ( )

html() public method

Return the HTML markup content of this view
public html ( ) : string
return string

initWithView() public static method

Return an instance of WPDKViewController class. This static method create a view controller with a view.
public static initWithView ( string $id, string $title, WPDKView $view ) : boolean | WPDKViewController
$id string The unique id for this view controller
$title string The title of this view controller. This is displayed on top header
$view WPDKView A instance of WPDKView class. This will be a subview.
return boolean | WPDKViewController The view controller or FALSE if error

load() public method

It is used by WPDKMenu for example, as 'load-' action.
Since: 1.4.18
public load ( )

willLoad() public static method

It is used by WPDKMenu for example, as 'load-' action.
public static willLoad ( )

Property Details

$__version public_oe property

Override version
public string $__version
return string

$id public_oe property

The unique id for this view controller
public string $id
return string

$title public_oe property

The title of this view controller. This is displayed on top header
public string $title
return string

$view public_oe property

The view stored in this property represents the root view for the view controller hierarchy.
public WPDKView $view
return WPDKView

$viewHead public_oe property

An instance of WPDKHeaderView
public WPDKHeaderView $viewHead
return WPDKHeaderView