/** Отрисовка формы */ public function render($attr = null) { return HTML::Form(sprintf($this->tmpl_fields, $this->renderFields(), $this->renderSubmit()), $this->getAction(), null, $this->getFormAttributes($attr)); }
function testForm() { $f = HTML::Form('<div></div>'); $this->assertSelectCount('form[action=] div', true, $f); $this->assertSelectCount('form[enctype=multipart/form-data]', true, $f); $f = HTML::Form('<div></div>', '/hello/', null, 'myclass'); $this->assertSelectCount('form[action=/hello/] div', true, $f); $this->assertSelectCount('form[class=myclass]', true, $f); $f = HTML::Form('<div></div>', '/hello/', 'wtf', array('id' => 'myform')); $this->assertSelectCount('form[action=/hello/] div', true, $f); $this->assertSelectCount('form[enctype=wtf] div', true, $f); $this->assertSelectCount('form[id=myform] div', true, $f); }