HTMLPurifier_ChildDef_Required::__construct PHP 메소드

__construct() 공개 메소드

public __construct ( array | string $elements )
$elements array | string List of allowed element names (lowercase).
    public function __construct($elements)
    {
        if (is_string($elements)) {
            $elements = str_replace(' ', '', $elements);
            $elements = explode('|', $elements);
        }
        $keys = array_keys($elements);
        if ($keys == array_keys($keys)) {
            $elements = array_flip($elements);
            foreach ($elements as $i => $x) {
                $elements[$i] = true;
                if (empty($i)) {
                    unset($elements[$i]);
                }
                // remove blank
            }
        }
        $this->elements = $elements;
    }
HTMLPurifier_ChildDef_Required