HTMLPurifier_Config::initDefinition PHP Method

initDefinition() private method

Initialise definition
private initDefinition ( string $type ) : HTMLPurifier_CSSDefinition | HTMLPurifier_HTMLDefinition | HTMLPurifier_URIDefinition
$type string What type of definition to create
return HTMLPurifier_CSSDefinition | HTMLPurifier_HTMLDefinition | HTMLPurifier_URIDefinition
    private function initDefinition($type)
    {
        // quick checks failed, let's create the object
        if ($type == 'HTML') {
            $def = new HTMLPurifier_HTMLDefinition();
        } elseif ($type == 'CSS') {
            $def = new HTMLPurifier_CSSDefinition();
        } elseif ($type == 'URI') {
            $def = new HTMLPurifier_URIDefinition();
        } else {
            throw new HTMLPurifier_Exception("Definition of {$type} type not supported");
        }
        $this->definitions[$type] = $def;
        return $def;
    }