function testButton() { $b = HTML::Button('Hello'); $this->assertEquals('<button type="button">Hello</button>', $b, 'Просто кнопка'); $b = HTML::Button('Hello', true); $this->assertSelectCount('button[type=submit]', true, $b, 'Кнопка submit'); $b = HTML::Button('Hello', false); $this->assertSelectCount('button[type=reset]', true, $b, 'Кнопка reset'); $b = HTML::Button('Hello', null, 'myclass'); $this->assertSelectCount('button[class=myclass]', true, $b, 'Кнопка с атрибутами'); }
/** * Отрисовка кнопки отправить форму. * $only_button - вывести только кнопку, без окружения */ public function renderSubmit($only_button = false) { $b = HTML::Button($this->submit['text'], true, $this->submit['attr']); return $only_button ? $b : sprintf($this->tmpl_submit, $b); }