PHP Класс Themosis\Page\PageBuilder

Наследование: extends Themosis\Field\Wrapper
Показать файл Открыть проект

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

Свойство Тип Описание
$action Themosis\Hook\IHook
$datas Themosis\Foundation\DataContainer The page properties.
$sections array The page sections.
$settings array The page settings.
$validator Themosis\Validation\ValidationBuilder The page validator object.
$view Illuminate\View\View The page view file.

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

Метод Описание
__construct ( DataContainer $datas, Illuminate\View\View $view, ValidationBuilder $validator, Themosis\Hook\IHook $action ) Build a Page instance.
addSections ( array $sections = [] ) : PageBuilder Add custom sections for your settings.
addSettings ( array $settings = [] ) : PageBuilder Add settings to the page. Define settings per section by setting the 'key' name equal to a registered section and pass it an array of 'settings' fields.
build ( ) Triggered by the 'admin_menu' action event.
displayPage ( ) Triggered by the 'add_menu_page' or 'add_submenu_page'.
displaySections ( array $args ) Handle section display of the Settings API.
displaySettings ( mixed $setting ) Handle setting display of the Settings API.
enqueueMediaUploader ( ) Enqueue the WordPress media scripts.
get ( string $property = null ) : mixed Return a page property value.
hasSections ( ) : boolean Check if the page has sections.
installSettings ( ) Triggered by the 'admin_init' action.
make ( string $slug, string $title, string $parent = null, Illuminate\View\View $view = null ) : PageBuilder
renderSettings ( ) Helper method that output the page settings.
renderTabs ( ) Helper method that output the tab navigation if available.
set ( array $params = [] ) : PageBuilder Set the custom page. Allow user to override the default page properties and add its own properties.
validate ( array $rules = [] ) : PageBuilder Set validation rules to settings.
validateSettings ( mixed $values ) : array Validate the defined settings.
with ( string | array $key, mixed $value = null ) : PageBuilder Allow a user to pass custom datas to the page view instance.

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

Метод Описание
getActiveTab ( ) : string Return the active tab slug of the settings page.
installWithTabs ( ) Register sections and settings in order to work with tabs.
installWithoutTabs ( ) Register sections and settings in a page.
isInfinite ( string $name ) : boolean Check if a field/settings is of type 'infinite'.
setTabUri ( string $default ) : string Define the tab URI. Check for extra query parameters.

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

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

Build a Page instance.
public __construct ( DataContainer $datas, Illuminate\View\View $view, ValidationBuilder $validator, Themosis\Hook\IHook $action )
$datas Themosis\Foundation\DataContainer The page properties.
$view Illuminate\View\View The page view file.
$validator Themosis\Validation\ValidationBuilder The page validator.
$action Themosis\Hook\IHook The Action builder class.

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

Add custom sections for your settings.
public addSections ( array $sections = [] ) : PageBuilder
$sections array
Результат PageBuilder

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

Add settings to the page. Define settings per section by setting the 'key' name equal to a registered section and pass it an array of 'settings' fields.
public addSettings ( array $settings = [] ) : PageBuilder
$settings array The page settings.
Результат PageBuilder

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

Register/display the custom page in the WordPress admin.
public build ( )

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

Triggered by the 'add_menu_page' or 'add_submenu_page'.
public displayPage ( )

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

Handle section display of the Settings API.
public displaySections ( array $args )
$args array

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

Handle setting display of the Settings API.
public displaySettings ( mixed $setting )
$setting mixed

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

Make the 'wp' object available to javascript.

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

Return a page property value.
public get ( string $property = null ) : mixed
$property string
Результат mixed

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

Return the active tab slug of the settings page.
protected getActiveTab ( ) : string
Результат string

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

Check if the page has sections.
public hasSections ( ) : boolean
Результат boolean

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

Perform the WordPress settings API.
public installSettings ( )

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

Register sections and settings in order to work with tabs.
protected installWithTabs ( )

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

Register sections and settings in a page.
protected installWithoutTabs ( )

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

Check if a field/settings is of type 'infinite'.
protected isInfinite ( string $name ) : boolean
$name string The name of the field/setting.
Результат boolean

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

public make ( string $slug, string $title, string $parent = null, Illuminate\View\View $view = null ) : PageBuilder
$slug string The page slug name.
$title string The page display title.
$parent string The parent's page slug if a subpage.
$view Illuminate\View\View The page main view file.
Результат PageBuilder

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

Helper method that output the page settings.
public renderSettings ( )

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

Helper method that output the tab navigation if available.
public renderTabs ( )

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

Set the custom page. Allow user to override the default page properties and add its own properties.
public set ( array $params = [] ) : PageBuilder
$params array
Результат PageBuilder

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

Define the tab URI. Check for extra query parameters.
protected setTabUri ( string $default ) : string
$default string The default URI to check. Mainly look for query parameters.
Результат string

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

Set validation rules to settings.
public validate ( array $rules = [] ) : PageBuilder
$rules array
Результат PageBuilder

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

Validate the defined settings.
public validateSettings ( mixed $values ) : array
$values mixed
Результат array

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

Allow a user to pass custom datas to the page view instance.
public with ( string | array $key, mixed $value = null ) : PageBuilder
$key string | array
$value mixed
Результат PageBuilder

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

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

protected IHook,Themosis\Hook $action
Результат Themosis\Hook\IHook

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

The page properties.
protected DataContainer,Themosis\Foundation $datas
Результат Themosis\Foundation\DataContainer

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

The page sections.
protected array $sections
Результат array

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

The page settings.
protected array $settings
Результат array

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

The page validator object.
protected ValidationBuilder,Themosis\Validation $validator
Результат Themosis\Validation\ValidationBuilder

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

The page view file.
protected View,Illuminate\View $view
Результат Illuminate\View\View