PHP 클래스 Themosis\Page\PageBuilder

상속: extends Themosis\Field\Wrapper
파일 보기 프로젝트 열기: themosis/framework

보호된 프로퍼티들

프로퍼티 타입 설명
$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