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 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.

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