Skip to main content

HelperPluginManager

Plugin manager implementation for HTML class attribute helpers

Enforces that helpers retrieved are instances of Helper\HelperInterface. Additionally, it registers a number of default helpers.


  • Full name: \TwbsHelper\View\Helper\HtmlAttributes\HtmlClass\HelperPluginManager
  • Parent class: AbstractPluginManager

Properties

aliases

Default helper aliases

protected string[] $aliases

factories

Default factories

protected array $factories

htmlclasshelper

protected \TwbsHelper\View\Helper\HtmlAttributes\HtmlClass|null $htmlclasshelper

Methods

__construct

Sets the provided $parentLocator as the creation context for all factories; for $config, {@see \Laminas\ServiceManager\ServiceManager::configure()} for details on its accepted structure.

public __construct(null|\Laminas\ServiceManager\ConfigInterface|\Psr\Container\ContainerInterface $configInstanceOrParentLocator = null, array $config = []): mixed

Parameters:

ParameterTypeDescription
$configInstanceOrParentLocatornull|\Laminas\ServiceManager\ConfigInterface|\Psr\Container\ContainerInterface
$configarray

injectHtmlClassHelper

Inject a helper instance with the registered htmlclasshelper

public injectHtmlClassHelper(mixed $first, mixed $second): mixed

Parameters:

ParameterTypeDescription
$firstmixed
$secondmixed

setHtmlClassHelper

Set htmlclasshelper

public setHtmlClassHelper(\TwbsHelper\View\Helper\HtmlAttributes\HtmlClass $htmlclasshelper): \TwbsHelper\View\Helper\HtmlAttributes\HtmlClass\HelperPluginManager

Parameters:

ParameterTypeDescription
$htmlclasshelper\TwbsHelper\View\Helper\HtmlAttributes\HtmlClass

getHtmlClassHelper

Retrieve HtmlClass helper instance

public getHtmlClassHelper(): null|\TwbsHelper\View\Helper\HtmlAttributes\HtmlClass

validate

Validate the plugin is of the expected type.

public validate(\TwbsHelper\View\Helper\HtmlAttributes\HtmlClass\Helper\HelperInterface|callable|mixed $instance): mixed

Validates against callables and HelperInterface implementations.

Parameters:

ParameterTypeDescription
$instance\TwbsHelper\View\Helper\HtmlAttributes\HtmlClass\Helper\HelperInterface|callable|mixed

Throws:

  • InvalidServiceException