Changeset 10236
- Timestamp:
- 07/12/08 09:06:52 (2 months ago)
- Files:
-
- branches/1.2/lib/widget/sfWidgetForm.class.php (modified) (1 diff)
- branches/1.2/test/unit/widget/sfWidgetFormTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/widget/sfWidgetForm.class.php
r9499 r10236 105 105 public function renderTag($tag, $attributes = array()) 106 106 { 107 return parent::renderTag($tag, $this->fixFormId($attributes)); 107 if (empty($tag)) 108 { 109 return ''; 110 } 111 112 $attributes = $this->fixFormId($attributes); 113 114 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : (strtolower($tag) == 'input' ? '>' : sprintf('></%s>', $tag))); 108 115 } 109 116 branches/1.2/test/unit/widget/sfWidgetFormTest.php
r5937 r10236 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(2 1, new lime_output_color());13 $t = new lime_test(22, new lime_output_color()); 14 14 15 15 class MyWidgetForm extends sfWidgetForm … … 61 61 $w->setIdFormat('id_%s'); 62 62 $t->is($w->renderTag('input', array('name' => 'foo')), '<input name="foo" id="id_foo" />', '->renderTag() uses the id_format to generate an id'); 63 sfWidget::setXhtml(false); 64 $t->is($w->renderTag('input'), '<input>', '->renderTag() does not close tag if not in XHTML mode'); 65 sfWidget::setXhtml(true); 63 66 64 67 // ->renderContentTag()