Exemple #1
0
 /**
  * Format the field with prepended/appended elements
  *
  * @param  Field $field The field to format
  *
  * @return string        Field plus supplementary elements
  */
 protected function prependAppend($field)
 {
     if (!$this->prepend and !$this->append) {
         return $field->render();
     }
     return $this->app['former.framework']->prependAppend($field, $this->prepend, $this->append);
 }
Exemple #2
0
	function render () {
		
		// Remove type attr, not used for SELECT fields
		unset($this->attrs['type']);
		
		return parent::render();
		
	}
 public function testRender()
 {
     $field = new Field();
     $field->setTitle('title')->setValue('value')->setShort(false);
     $this->assertEquals(['title' => 'title', 'value' => 'value', 'short' => false], $field->render());
 }
Exemple #4
0
 public function testFieldWithInputAttrsOption()
 {
     $f = new Field(array('input_attrs' => array('class' => 'foo')));
     $this->assertEquals('<input type="text" name="foo" class="foo" value="bar" />', $f->render('foo', 'bar'));
 }