Development

Changeset 10236

You must first sign up to be able to contribute.

Changeset 10236

Show
Ignore:
Timestamp:
07/12/08 09:06:52 (2 months ago)
Author:
Carl.Vondrick
Message:

1.2: merged r10235

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/widget/sfWidgetForm.class.php

    r9499 r10236  
    105105  public function renderTag($tag, $attributes = array()) 
    106106  { 
    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))); 
    108115  } 
    109116 
  • branches/1.2/test/unit/widget/sfWidgetFormTest.php

    r5937 r10236  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(21, new lime_output_color()); 
     13$t = new lime_test(22, new lime_output_color()); 
    1414 
    1515class MyWidgetForm extends sfWidgetForm 
     
    6161$w->setIdFormat('id_%s'); 
    6262$t->is($w->renderTag('input', array('name' => 'foo')), '<input name="foo" id="id_foo" />', '->renderTag() uses the id_format to generate an id'); 
     63sfWidget::setXhtml(false); 
     64$t->is($w->renderTag('input'), '<input>', '->renderTag() does not close tag if not in XHTML mode'); 
     65sfWidget::setXhtml(true); 
    6366 
    6467// ->renderContentTag()