View

Last updatedView as Markdown

View Class


  • Full name: \Linchpin_SatisPress\Core\View

Properties

variables

Variables for substitution in templates.

protected array $variables

Methods

assign

Assigns variables for substitution in templates.

public assign(string $variable, mixed $value): void

Parameters:

ParameterTypeDescription
$variablestringThe variable's name.
$valuemixedThe variable's value.

get_view_template

Get our view template either in the active theme directory or in our plugin templates

private get_view_template(string $file, string $view_dir = ''): string

Parameters:

ParameterTypeDescription
$filestringFile to get HTML string.
$view_dirstringView directory.

the_view

Echos the view/template

public the_view(string $file, string $view_dir = ''): void

Useful for echoing any content and also look in a local theme directory first to override templates

Parameters:

ParameterTypeDescription
$filestringFile to get HTML string.
$view_dirstringView directory.

get_view

Returns the view.

public get_view(string $file, string $view_dir = ''): string

Useful for shortcodes, or whenever the markup needs to be returned.

Parameters:

ParameterTypeDescription
$filestringFile to get HTML string.
$view_dirstringView directory.

Return Value:

$html HTML output as string.


init_assignments

Reset the variables.

protected init_assignments(): void

Have a question about this page?

Linchpin assistant

Was this helpful?