Example #1
0
 function testRender()
 {
     $e = new Caption('test', 'Heading');
     $exp = '<h3 id="form-test">Heading</h3>';
     $this->assertEquals($exp, $e->render());
     $e->setTag('span');
     $e->setAttributes('hello');
     $exp = '<span class="hello" id="form-test">Heading</span>';
     $this->assertEquals($exp, $e->render());
 }
Example #2
0
File: Form.php Project: cmsx/form
 /** @return Form\Element\Caption */
 public function addCaption($field, $label, $info = null)
 {
     $c = new Caption($field, $label, $this);
     if ($info) {
         $c->setInfo($info);
     }
     return $this->fields[$field] = $c;
 }