Cms\Classes\Controller\HasComponentHelpers
Public Methods
public addComponent()
public addComponent(
mixed $name,
string $alias,
array $properties = [],
bool $addToLayout = false
): ComponentBase|null
addComponent class or short name to the page or layout object, assigning it an alias with configuration as properties.
public addComponentInstance()
public addComponentInstance($alias, $instance): void
public findComponentByHandler()
public findComponentByHandler(string $handler): ComponentBase|null
findComponentByHandler searches the layout and page components by an AJAX handler and returns the component object if found.
public findComponentByName()
public findComponentByName($name $name): ComponentBase|null
findComponentByName searches the layout and page components by an alias and returns the component object if found.
public findComponentByPartial()
public findComponentByPartial(string $partial): ComponentBase|null
findComponentByPartial searches the layout and page components by a partial file and returns the component object if found.
public getComponentInstance()
public getComponentInstance($alias): Larajax\Contracts\ViewComponentInterface
getComponentInstance returns an instance of a component based on its alias
Protected Methods
protected addPartialComponent()
protected addPartialComponent(
$partial,
&$vars,
$name,
$alias,
$properties = []
): void
addPartialComponent adds a component to a partial object, used internally by the public renderPartial method
protected initComponent()
protected initComponent($component): void
initComponent fires lifecycle events then calls ComponentBase::init()