Same name and namespace in other branches
- 8.x-1.x src/ActivationCheck.php \Drupal\colorbox\ActivationCheck 1 comment
Implementation of ActivationCheckInterface.
Hierarchy
- class \Drupal\colorbox\ActivationCheck implements \Drupal\colorbox\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\Request
*/
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
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ActivationCheck::$request | protected | property | The request stack. | |
ActivationCheck::$settings | protected | property | The colorbox settings. | |
ActivationCheck::isActive | public | function | Check if colorbox should be activated for the current page. | Overrides ActivationCheckInterface::isActive |
ActivationCheck::__construct | public | function | Create an instace of ActivationCheck. |