Log in
Model

DynamicCollector

Magento\Csp\Model\Collector\DynamicCollector

What it does

This class allows developers to dynamically add Content Security Policy (CSP) rules during page rendering, such as from .phtml templates.

It collects and merges these runtime policies with default policies, making it useful when CSP requirements can only be determined during template execution rather than through static configuration.

Public Methods

  • add()
  • collect()