/** * 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); }
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()); }
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')); }