Skip to content

Argument Validate Plugins

Plugins for validating views contextual filters.

Views argument validator plugins validate arguments (contextual filters) on views. They can ensure arguments are valid, and even do transformations on the arguments. They can also provide replacement patterns for the view title. For example, the 'content' validator verifies that the argument value corresponds to a node, loads that node, and provides the node title as a replacement pattern for the view title.

Argument validator plugins extend \Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase. They must be annotated with \Drupal\views\Annotation\ViewsArgumentValidator annotation, and they must be in namespace directory Plugin\views\argument_validator.

See also

Plugin API

Parent topics

Views plugins