SLP® phpDocs

Customer_Profile_History extends SLP_Base_ReactObject
in package

Customer Profile History React Block

Renders a WordPress-centric React component that will eventually replace the legacy PHP-rendered customer history. For now, this only enqueues the React bundle and renders a wrapper div where the React app will mount.

Table of Contents

Properties

$addon  : object
$buildDir  : string
$buildURL  : string
$myslp  : MySLP
$pageName  : string
$scriptAssetFile  : string
$scriptFile  : string
$scriptURL  : string
$slplus  : SLPlus
$uses_slplus  : bool
$pluginDir  : mixed
Where to find built assets and how to name the script.
$pluginURL  : mixed
$scriptFilebase  : mixed
$scriptHandle  : mixed
$slug  : mixed
$uses_myslp  : bool
$wrapper_class  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
extendReactVars()  : array<string|int, mixed>
Extend variables passed to React. Minimal for now; can be expanded later.
get_instance()  : static
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
render()  : void
Render admin page - default can be overriden.
set_properties()  : mixed
Set our properties.
enqueueReact()  : void
Things we normally want to do before each render
get_vars_for_react()  : array<string|int, mixed>
Pass data from PHP to React JavaScript environment.
initialize()  : void
Setup hooks for extending the React variables if needed.

Properties

$buildDir read-only

public string $buildDir

The build directory where the React script lives.

$pageName

public string $pageName

The page name for React, update with initialize() override.

$scriptAssetFile read-only

public string $scriptAssetFile

The fully qualified file name for the React script supporting asset PHP file.

$scriptFile read-only

public string $scriptFile

The fully qualified file name for the React script.

$uses_slplus

public bool $uses_slplus

Default false try to use SLPlus::get_instance() legacy models that use $this->slplus must set this to true.

$pluginDir

Where to find built assets and how to name the script.

protected mixed $pluginDir = \MYSLP_PLUGIN_DIR

Methods

__construct()

public __construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

__isset()

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

extendReactVars()

Extend variables passed to React. Minimal for now; can be expanded later.

public extendReactVars(array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
$vars : array<string|int, mixed>
Return values
array<string|int, mixed>

get_instance()

Return an instance of the object which is also registered to the slplus global less the SLP_ part.

public static get_instance([bool $no_global = false ][, mixed $params = array() ]) : static
Parameters
$no_global : bool = false

set to true to skip assigning object to SLP global as a property.

$params : mixed = array()

object init params

Return values
static

render()

Render admin page - default can be overriden.

public render() : void

Provide the DOM element where the React app will render: slp-full-page-react-app

set_properties()

Set our properties.

public set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

enqueueReact()

Things we normally want to do before each render

protected enqueueReact() : void

get_vars_for_react()

Pass data from PHP to React JavaScript environment.

protected get_vars_for_react() : array<string|int, mixed>

Use this for one-time setup, things that are mostly static in PHP but you need to send to JS.

Return values
array<string|int, mixed>

initialize()

Setup hooks for extending the React variables if needed.

protected final initialize() : void

Keep minimal for the initial template.


        
On this page

Search results