PageCode
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
Helper method for ::extend() static method
Clear the list of extended classes so they will be re-extended.
Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes
Dynamically extend a class with a specified behavior
Extracts the available methods from a behavior and adds it to the list of callable methods.
Programmatically adds a method to the extendable class
Programatically adds a property to the extendable class
Check if extendable class is extended with a behavior object
Returns a behavior object from an extendable class, example:
Short hand for getClassExtension() method, except takes the short extension name, example:
Checks if a method exists, extension equivalent of method_exists()
Get a list of class methods, extension equivalent of get_class_methods()
Checks if a property exists, extension equivalent of property_exists()
Checks if a property is accessible, property equivalent of is_callabe()
Magic method for __call()
Magic method for __callStatic()
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']
Dynamically handle calls into the controller instance.
This event is triggered when all components are initialized and before AJAX is handled.
This event is triggered in the end of the execution cycle, but before the page is displayed.
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
in
ExtendableTrait at line 120
static void
clearExtendedClasses()
Clear the list of extended classes so they will be re-extended.
in
ExtendableTrait at line 131
protected string
extensionNormalizeClassName(string $name)
Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes
in
ExtendableTrait at line 149
void|ExtendableTrait
extendClassWith(string $extensionName)
Dynamically extend a class with a specified behavior
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.
in
ExtendableTrait at line 206
addDynamicMethod(string $dynamicName, callable $method, string $extension = null)
Programmatically adds a method to the extendable class
in
ExtendableTrait at line 225
addDynamicProperty(string $dynamicName, string $value = null)
Programatically adds a property to the extendable class
in
ExtendableTrait at line 249
bool
isClassExtendedWith(string $name)
Check if extendable class is extended with a behavior object
in
ExtendableTrait at line 265
mixed
getClassExtension(string $name)
Returns a behavior object from an extendable class, example:
$this->getClassExtension('Admin.Actions.FormController')
in
ExtendableTrait at line 280
mixed
asExtension(string $shortName)
Short hand for getClassExtension() method, except takes the short extension name, example:
$this->asExtension('FormController')
in
ExtendableTrait at line 301
bool
methodExists(string $name)
Checks if a method exists, extension equivalent of method_exists()
in
ExtendableTrait at line 313
array
getClassMethods()
Get a list of class methods, extension equivalent of get_class_methods()
in
ExtendableTrait at line 326
array
getDynamicProperties()
Returns all dynamic properties and their values
in
ExtendableTrait at line 344
bool
propertyExists(string $name)
Checks if a property exists, extension equivalent of property_exists()
in
ExtendableTrait at line 370
protected bool
extendableIsAccessible(mixed $class, string $propertyName)
Checks if a property is accessible, property equivalent of is_callabe()
in
ExtendableTrait at line 385
string
extendableGet(string $name)
Magic method for __get()
in
ExtendableTrait at line 410
string
extendableSet(string $name, string $value)
Magic method for __set()
in
ExtendableTrait at line 444
mixed
extendableCall(string $name, array $params = null)
Magic method for __call()
in
ExtendableTrait at line 483
static mixed
extendableCallStatic(string $name, array $params = null)
Magic method for __callStatic()
in
ExtendableTrait at line 552
protected ClassLoader|null
extensionGetClassLoader()
Gets the class loader
in
TemplateCode at line 35
__construct(Page $page, Layout $layout, MainController $controller)
Creates the object instance.
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']
in
TemplateCode at line 168
__set($name, $value)
This will set a property on the Page object.
in
TemplateCode at line 121
__call(string $method, array $parameters)
Dynamically handle calls into the controller instance.
in
Extendable at line 45
static
__callStatic($name, $params)
No description
in
Extendable at line 50
static
extend(callable $callback)
No description
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
in
TemplateCode at line 86
bool
offsetExists($offset)
ArrayAccess implementation
in
TemplateCode at line 96
offsetUnset($offset)
ArrayAccess implementation
in
TemplateCode at line 108
null
offsetGet($offset)
ArrayAccess implementation
in
TemplateCode at line 180
bool
__isset(string $name)
This will check if a property isset on the CMS Page object.