class View

Properties

protected $container A plugin instance container.
protected $key
protected $data
protected array $adminStyles List of styles and script to enqueue in admin area.
protected $adminScripts
protected array $styles List of styles and script to enqueue in frontend.
protected $scripts

Methods

__construct(mixed $container, null $key = null, null $data = null)

Create a new View.

string
filename()

Get the filename.

admin_print_styles()

No description

admin_enqueue_scripts()

No description

wp_print_styles()

No description

wp_enqueue_scripts()

No description

string
__toString()

Get the string rappresentation of a view.

string
toHTML()

Return the content of view.

mixed
render(bool $asHTML = false)

Get the view content.

$this
withAdminStyles(string $name, array $deps = [], array $ver = [])

Load a new css resource in admin area.

$this
withAdminScripts(string $name, array $deps = [], array $ver = [])

Load a new css resource in admin area.

$this
withStyles(string $name, array $deps = [], array $ver = [])

Load a new css resource in frontend.

$this
withScripts(string $name, array $deps = [], array $ver = [])

Load a new css resource in fonrend.

$this
with(mixed $data)

Data to pass to the view.

Details

at line 44
__construct(mixed $container, null $key = null, null $data = null)

Create a new View.

Parameters

mixed $container Usually a container/plugin.
null $key Optional. This is the path of view.
null $data Optional. Any data to pass to view.

at line 56
protected string filename()

Get the filename.

Return Value

string

at line 63
protected admin_print_styles()

at line 74
protected admin_enqueue_scripts()

at line 85
protected wp_print_styles()

at line 96
protected wp_enqueue_scripts()

at line 112
string __toString()

Get the string rappresentation of a view.

Return Value

string

at line 122
string toHTML()

Return the content of view.

Return Value

string

at line 140
mixed render(bool $asHTML = false)

Get the view content.

Parameters

bool $asHTML Set to TRUE to get the content of view as string/html.

Return Value

mixed

at line 191
$this withAdminStyles(string $name, array $deps = [], array $ver = [])

Load a new css resource in admin area.

Parameters

string $name Name of style.
array $deps Optional. Array of slug deps
array $ver Optional. Version.

Return Value

$this

at line 207
$this withAdminScripts(string $name, array $deps = [], array $ver = [])

Load a new css resource in admin area.

Parameters

string $name Name of script.
array $deps Optional. Array of slug deps
array $ver Optional. Version.

Return Value

$this

at line 223
$this withStyles(string $name, array $deps = [], array $ver = [])

Load a new css resource in frontend.

Parameters

string $name Name of style.
array $deps Optional. Array of slug deps
array $ver Optional. Version.

Return Value

$this

at line 239
$this withScripts(string $name, array $deps = [], array $ver = [])

Load a new css resource in fonrend.

Parameters

string $name Name of script.
array $deps Optional. Array of slug deps
array $ver Optional. Version.

Return Value

$this

at line 256
$this with(mixed $data)

Data to pass to the view.

Parameters

mixed $data Array or single data.

Return Value

$this