Example #1
0
 public function testRenderWithMaxLength()
 {
     $field = new TextField('name', array('max_length' => 10));
     $field->setData('asdf');
     $html = '<input id="name" name="name" value="asdf" type="text" maxlength="10" />';
     $this->assertEquals($html, $field->render());
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function render(array $attributes = array())
 {
     return parent::render(array_merge(array('value' => $this->getOption('always_empty') && !$this->isBound() ? '' : $this->getDisplayedData(), 'type' => 'password'), $attributes));
 }