class DynamicUserHelpLink in Lightweight Directory Access Protocol (LDAP) 8.4
Same name and namespace in other branches
- 8.3 ldap_authentication/src/Plugin/Derivative/DynamicUserHelpLink.php \Drupal\ldap_authentication\Plugin\Derivative\DynamicUserHelpLink
Provides help messages for users when configured.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\ldap_authentication\Plugin\Derivative\DynamicUserHelpLink implements ContainerDeriverInterface
Expanded class hierarchy of DynamicUserHelpLink
1 string reference to 'DynamicUserHelpLink'
- ldap_authentication.links.task.yml in ldap_authentication/
ldap_authentication.links.task.yml - ldap_authentication/ldap_authentication.links.task.yml
File
- ldap_authentication/
src/ Plugin/ Derivative/ DynamicUserHelpLink.php, line 15
Namespace
Drupal\ldap_authentication\Plugin\DerivativeView source
class DynamicUserHelpLink extends DeriverBase implements ContainerDeriverInterface {
/**
* Config.
*
* @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig
*/
private $config;
/**
* Constructor.
*
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* Config Factory.
*/
public function __construct(ConfigFactory $config_factory) {
$this->config = $config_factory
->get('ldap_authentication.settings');
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) : DynamicUserHelpLink {
return new static($container
->get('config.factory'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($basePluginDefinition) : array {
if ($this->config
->get('ldapUserHelpLinkText') && $this->config
->get('ldapUserHelpLinkUrl')) {
$basePluginDefinition['title'] = $this->config
->get('ldapUserHelpLinkText');
$basePluginDefinition['route_name'] = 'ldap_authentication.ldap_help_redirect';
$this->derivatives['ldap_authentication.show_user_help_link'] = $basePluginDefinition;
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
DynamicUserHelpLink:: |
private | property | Config. | |
DynamicUserHelpLink:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
DynamicUserHelpLink:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
DynamicUserHelpLink:: |
public | function | Constructor. |