class ActivationCheck in Colorbox 8
Implementation of ActivationCheckInterface.
Hierarchy
- class \Drupal\colorbox\ActivationCheck implements ActivationCheckInterface
Expanded class hierarchy of ActivationCheck
1 string reference to 'ActivationCheck'
1 service uses ActivationCheck
File
- src/
ActivationCheck.php, line 11
Namespace
Drupal\colorboxView source
class ActivationCheck implements ActivationCheckInterface {
/**
* The colorbox settings.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $settings;
/**
* The request stack.
*
* @var \Symfony\Component\HttpFoundation\RequestStack
*/
protected $request;
/**
* Create an instace of ActivationCheck.
*/
public function __construct(ConfigFactoryInterface $config, RequestStack $request) {
$this->settings = $config
->get('colorbox.settings');
$this->request = $request
->getCurrentRequest();
}
/**
* {@inheritdoc}
*/
public function isActive() {
return $this->request
->get('colorbox') !== 'no';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ActivationCheck:: |
protected | property | The request stack. | |
ActivationCheck:: |
protected | property | The colorbox settings. | |
ActivationCheck:: |
public | function |
Check if colorbox should be activated for the current page. Overrides ActivationCheckInterface:: |
|
ActivationCheck:: |
public | function | Create an instace of ActivationCheck. |