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:
| Parameter | Type | Description |
|---|---|---|
$configInstanceOrParentLocator | null|\Laminas\ServiceManager\ConfigInterface|\Psr\Container\ContainerInterface | |
$config | array |
injectHtmlClassHelper
Inject a helper instance with the registered htmlclasshelper
public injectHtmlClassHelper(mixed $first, mixed $second): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$first | mixed | |
$second | mixed |
setHtmlClassHelper
Set htmlclasshelper
public setHtmlClassHelper(\TwbsHelper\View\Helper\HtmlAttributes\HtmlClass $htmlclasshelper): \TwbsHelper\View\Helper\HtmlAttributes\HtmlClass\HelperPluginManager
Parameters:
| Parameter | Type | Description |
|---|---|---|
$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:
| Parameter | Type | Description |
|---|---|---|
$instance | \TwbsHelper\View\Helper\HtmlAttributes\HtmlClass\Helper\HelperInterface|callable|mixed |
Throws:
InvalidServiceException