samedi 30 septembre 2017

htmlpurifier "checked" checkbox

I need to allow checkbox to be checked in the htmlpurifier. For now, I successfully allowed checkbox, but the plugin cut CHECKED attribute. Is there way to allow the CHECK attribute in the checkbox in htmlpurifier?

That's what I have for now:

$checkbox = $def->addElement(  // adding checkbox rule to HTMLPurifier
  'input',   // name
  'Block',  // content set
  'Empty', // allowed children
  'Common', // attribute collection
  array( // attributes
    'type' => new HTMLPurifier_AttrDef_Enum(array('checkbox')),
    'id' => 'Number',
    'class' => 'Text',
    'value' => 'Number',

  )
);
$checkbox->excludes = array('checkbox' => true);




Aucun commentaire:

Enregistrer un commentaire