Пример #1
0
 public function testPhpBug745Workaround()
 {
     $image1 = new HTML_QuickForm2_Element_InputImage('foo');
     $this->assertRegExp('/name="foo"/', $image1->__toString());
     $image2 = new HTML_QuickForm2_Element_InputImage('foo[bar]');
     $this->assertRegExp('/name="foo\\[bar\\]\\[\\]"/', $image2->__toString());
     $this->assertEquals('foo[bar]', $image2->getName());
     $image3 = new HTML_QuickForm2_Element_InputImage('foo[bar][]');
     $this->assertRegExp('/name="foo\\[bar\\]\\[\\]"/', $image3->__toString());
     $this->assertEquals('foo[bar][]', $image3->getName());
 }
Пример #2
0
 /**
  * Disallow changing the 'id' attribute
  *
  * @param    string  Attribute name
  * @param    string  Attribute value, null if attribute is being removed
  */
 protected function onAttributeChange($name, $value = null)
 {
     if ('id' == $name) {
         throw new HTML_QuickForm2_InvalidArgumentException("Attribute 'id' is read-only");
     }
     parent::onAttributeChange($name, $value);
 }