Prado\Web\UI\THtmlWriter::removeAttribute PHP Method

removeAttribute() public method

Removes the named attribute from rendering
public removeAttribute ( $name )
    public function removeAttribute($name)
    {
        unset($this->_attributes[THttpUtility::htmlStrip($name)]);
    }

Usage Example

Beispiel #1
0
 public function testRemoveAttribute()
 {
     $writer = new THtmlWriter(self::$output);
     $writer->addAttribute('type', 'text');
     $writer->addAttribute('value', 'Prado & Cie');
     $writer->removeAttribute('value');
     $result = self::readAttribute($writer, '_attributes');
     // 'type' should be present, 'value' not
     self::assertTrue(isset($result['type']));
     self::assertFalse(isset($result['value']));
 }