class PageCode extends TemplateCode

Traits

Extendable Trait Allows for "Private traits"

Properties

protected array $extensionData from  ExtendableTrait
static protected array $extendableCallbacks from  ExtendableTrait
static protected array $extendableStaticMethods from  ExtendableTrait
static protected bool $extendableGuardProperties from  ExtendableTrait
static protected ClassLoader $extendableClassLoader from  ExtendableTrait
$implement from  Extendable
Page $page from  TemplateCode
Layout $layout from  TemplateCode
MainController $controller from  TemplateCode

Methods

extendableConstruct()

Constructor.

static void
extendableExtendCallback(callable $callback)

Helper method for ::extend() static method

static void
clearExtendedClasses()

Clear the list of extended classes so they will be re-extended.

string
extensionNormalizeClassName(string $name)

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

extendClassWith(string $extensionName)

Dynamically extend a class with a specified behavior

void
extensionExtractMethods(string $extensionName, object $extensionObject)

Extracts the available methods from a behavior and adds it to the list of callable methods.

addDynamicMethod(string $dynamicName, callable $method, string $extension = null)

Programmatically adds a method to the extendable class

addDynamicProperty(string $dynamicName, string $value = null)

Programatically adds a property to the extendable class

bool
isClassExtendedWith(string $name)

Check if extendable class is extended with a behavior object

mixed
getClassExtension(string $name)

Returns a behavior object from an extendable class, example:

mixed
asExtension(string $shortName)

Short hand for getClassExtension() method, except takes the short extension name, example:

bool
methodExists(string $name)

Checks if a method exists, extension equivalent of method_exists()

array
getClassMethods()

Get a list of class methods, extension equivalent of get_class_methods()

array
getDynamicProperties()

Returns all dynamic properties and their values

bool
propertyExists(string $name)

Checks if a property exists, extension equivalent of property_exists()

bool
extendableIsAccessible(mixed $class, string $propertyName)

Checks if a property is accessible, property equivalent of is_callabe()

string
extendableGet(string $name)

Magic method for __get()

string
extendableSet(string $name, string $value)

Magic method for __set()

mixed
extendableCall(string $name, array $params = null)

Magic method for __call()

static mixed
extendableCallStatic(string $name, array $params = null)

Magic method for __callStatic()

ClassLoader|null
extensionGetClassLoader()

Gets the class loader

__construct(Page $page, Layout $layout, MainController $controller)

Creates the object instance.

__get($name)

This object is referenced as $this->page in System\Classes\BaseComponent, so to avoid $this->page->page this method will proxy there. This is also used as a helper for accessing controller variables/components easier in the page code, eg. $this->foo instead of $this['foo']

__set($name, $value)

This will set a property on the Page object.

__call(string $method, array $parameters)

Dynamically handle calls into the controller instance.

static 
__callStatic($name, $params)

No description

static 
extend(callable $callback)

No description

onInit()

This event is triggered when all components are initialized and before AJAX is handled.

onStart()

This event is triggered in the beginning of the execution cycle.

onEnd()

This event is triggered in the end of the execution cycle, but before the page is displayed.

offsetSet($offset, $value)

ArrayAccess implementation

bool
offsetExists($offset)

ArrayAccess implementation

offsetUnset($offset)

ArrayAccess implementation

null
offsetGet($offset)

ArrayAccess implementation

bool
__isset(string $name)

This will check if a property isset on the CMS Page object.

Details

in ExtendableTrait at line 55
extendableConstruct()

Constructor.

in ExtendableTrait at line 103
static void extendableExtendCallback(callable $callback)

Helper method for ::extend() static method

Parameters

callable $callback

Return Value

void

in ExtendableTrait at line 120
static void clearExtendedClasses()

Clear the list of extended classes so they will be re-extended.

Return Value

void

in ExtendableTrait at line 131
protected string extensionNormalizeClassName(string $name)

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

Parameters

string $name

Return Value

string

in ExtendableTrait at line 149
void|ExtendableTrait extendClassWith(string $extensionName)

Dynamically extend a class with a specified behavior

Parameters

string $extensionName

Return Value

void|ExtendableTrait

Exceptions

Exception

in ExtendableTrait at line 178
protected void extensionExtractMethods(string $extensionName, object $extensionObject)

Extracts the available methods from a behavior and adds it to the list of callable methods.

Parameters

string $extensionName
object $extensionObject

Return Value

void

in ExtendableTrait at line 206
addDynamicMethod(string $dynamicName, callable $method, string $extension = null)

Programmatically adds a method to the extendable class

Parameters

string $dynamicName
callable $method
string $extension

in ExtendableTrait at line 225
addDynamicProperty(string $dynamicName, string $value = null)

Programatically adds a property to the extendable class

Parameters

string $dynamicName
string $value

in ExtendableTrait at line 249
bool isClassExtendedWith(string $name)

Check if extendable class is extended with a behavior object

Parameters

string $name

Fully qualified behavior name

Return Value

bool

in ExtendableTrait at line 265
mixed getClassExtension(string $name)

Returns a behavior object from an extendable class, example:

$this->getClassExtension('Admin.Actions.FormController')

Parameters

string $name

Fully qualified behavior name

Return Value

mixed

in ExtendableTrait at line 280
mixed asExtension(string $shortName)

Short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

Parameters

string $shortName

Return Value

mixed

in ExtendableTrait at line 301
bool methodExists(string $name)

Checks if a method exists, extension equivalent of method_exists()

Parameters

string $name

Return Value

bool

in ExtendableTrait at line 313
array getClassMethods()

Get a list of class methods, extension equivalent of get_class_methods()

Return Value

array

in ExtendableTrait at line 326
array getDynamicProperties()

Returns all dynamic properties and their values

Return Value

array

['property' => 'value']

in ExtendableTrait at line 344
bool propertyExists(string $name)

Checks if a property exists, extension equivalent of property_exists()

Parameters

string $name

Return Value

bool

in ExtendableTrait at line 370
protected bool extendableIsAccessible(mixed $class, string $propertyName)

Checks if a property is accessible, property equivalent of is_callabe()

Parameters

mixed $class
string $propertyName

Return Value

bool

in ExtendableTrait at line 385
string extendableGet(string $name)

Magic method for __get()

Parameters

string $name

Return Value

string

in ExtendableTrait at line 410
string extendableSet(string $name, string $value)

Magic method for __set()

Parameters

string $name
string $value

Return Value

string

in ExtendableTrait at line 444
mixed extendableCall(string $name, array $params = null)

Magic method for __call()

Parameters

string $name
array $params

Return Value

mixed

in ExtendableTrait at line 483
static mixed extendableCallStatic(string $name, array $params = null)

Magic method for __callStatic()

Parameters

string $name
array $params

Return Value

mixed

in ExtendableTrait at line 552
protected ClassLoader|null extensionGetClassLoader()

Gets the class loader

Return Value

ClassLoader|null

in TemplateCode at line 35
__construct(Page $page, Layout $layout, MainController $controller)

Creates the object instance.

Parameters

Page $page

The template page.

Layout $layout

The template layout.

MainController $controller

The template controller.

in TemplateCode at line 143
__get($name)

This object is referenced as $this->page in System\Classes\BaseComponent, so to avoid $this->page->page this method will proxy there. This is also used as a helper for accessing controller variables/components easier in the page code, eg. $this->foo instead of $this['foo']

Parameters

$name

in TemplateCode at line 168
__set($name, $value)

This will set a property on the Page object.

Parameters

$name
$value

in TemplateCode at line 121
__call(string $method, array $parameters)

Dynamically handle calls into the controller instance.

Parameters

string $method
array $parameters

in Extendable at line 45
static __callStatic($name, $params)

No description

Parameters

$name
$params

in Extendable at line 50
static extend(callable $callback)

No description

Parameters

callable $callback

in TemplateCode at line 48
onInit()

This event is triggered when all components are initialized and before AJAX is handled.

The layout's onInit method triggers before the page's onInit method.

in TemplateCode at line 56
onStart()

This event is triggered in the beginning of the execution cycle.

The layout's onStart method triggers before the page's onStart method.

in TemplateCode at line 64
onEnd()

This event is triggered in the end of the execution cycle, but before the page is displayed.

The layout's onEnd method triggers after the page's onEnd method.

in TemplateCode at line 74
offsetSet($offset, $value)

ArrayAccess implementation

Parameters

$offset
$value

in TemplateCode at line 86
bool offsetExists($offset)

ArrayAccess implementation

Parameters

$offset

Return Value

bool

in TemplateCode at line 96
offsetUnset($offset)

ArrayAccess implementation

Parameters

$offset

in TemplateCode at line 108
null offsetGet($offset)

ArrayAccess implementation

Parameters

$offset

Return Value

null

in TemplateCode at line 180
bool __isset(string $name)

This will check if a property isset on the CMS Page object.

Parameters

string $name

Return Value

bool