HTMLPurifier_ElementDef::create PHP Method

create() public static method

Low-level factory constructor for creating new standalone element defs
public static create ( $content_model, $content_model_type, $attr )
    public static function create($content_model, $content_model_type, $attr)
    {
        $def = new HTMLPurifier_ElementDef();
        $def->content_model = $content_model;
        $def->content_model_type = $content_model_type;
        $def->attr = $attr;
        return $def;
    }

Usage Example

 public function setup($config)
 {
     $newObject = HTMLPurifier_ElementDef::create(null, null, array('type' => 'Enum#application/x-shockwave-flash,image/svg+xml', 'width' => 'Length#1280', 'height' => 'Length#1920'));
     parent::setup($config);
     $object =& $this->info['object'];
     $object->mergeIn($newObject);
     $param =& $this->info['param'];
     $param->attr_transform_post[count($param->attr_transform_post) - 1] = new OC_HTMLPurifier_AttrTransform_SafeParam();
     unset($this->info_injector[count($this->info_injector) - 1]);
     $this->info_injector[] = new OC_HTMLPurifier_Injector_SafeObject();
 }
All Usage Examples Of HTMLPurifier_ElementDef::create