class AddToHeadParamConverter in Add To Head 8
Hierarchy
- class \Drupal\add_to_head\ParamConverter\AddToHeadParamConverter implements ParamConverterInterface
Expanded class hierarchy of AddToHeadParamConverter
1 string reference to 'AddToHeadParamConverter'
1 service uses AddToHeadParamConverter
File
- src/
ParamConverter/ AddToHeadParamConverter.php, line 8
Namespace
Drupal\add_to_head\ParamConverterView source
class AddToHeadParamConverter implements ParamConverterInterface {
public function convert($value, $definition, $name, array $defaults) {
$settings = add_to_head_get_settings();
return array_key_exists($value, $settings) ? $settings[$value] : FALSE;
}
public function applies($definition, $name, Route $route) {
// Stop this running on anything other than the add_to_head_profile type.
// This breaks router items such as node/edit etc if we dont catch it.
return isset($definition['type']) && $definition['type'] == 'add_to_head_profile' ? TRUE : FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AddToHeadParamConverter:: |
public | function |
Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface:: |
|
AddToHeadParamConverter:: |
public | function |
Converts path variables to their corresponding objects. Overrides ParamConverterInterface:: |