HTMLPurifier_DefinitionCacheFactory::addDecorator PHP Method

addDecorator() public method

Registers a decorator to add to all new cache objects
public addDecorator ( HTMLPurifier_DefinitionCache_Decorator | string $decorator )
$decorator HTMLPurifier_DefinitionCache_Decorator | string An instance or the name of a decorator
    public function addDecorator($decorator)
    {
        if (is_string($decorator)) {
            $class = "HTMLPurifier_DefinitionCache_Decorator_{$decorator}";
            $decorator = new $class();
        }
        $this->decorators[$decorator->name] = $decorator;
    }