Skip to content

Commit b1bee41

Browse files
author
Michael Herold
committed
Fixes bug in plain template
1 parent 2162c6a commit b1bee41

3 files changed

Lines changed: 43 additions & 2 deletions

File tree

src/FieldSubmit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function fill() {
3838
$template = $this->getFieldTemplateClone('SUBMIT');
3939

4040
$this['_TEMPLATE'] = $template;
41+
$this->control['TEXT'] = new \hemio\html\String($this->title);
4142
$template->init($this, $this->control);
4243

4344
$this->filled = true;

src/template/FormPlainControl.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public function init(Abstract_\FormField $field, Submittable $control) {
4343
$control->setAttribute('name', $field->getHtmlName());
4444
$control->setId($field->getHtmlName());
4545

46-
$this['BUTTON'] = $control;
47-
$control['STRING'] = new \hemio\html\String($field->title);
46+
$this->addChild($control);
4847

4948
$hook = $this->postInitHook;
5049
$hook($this);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* Copyright (C) 2015 Michael Herold <quabla@hemio.de>
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
namespace hemio\form\template;
21+
22+
/**
23+
* Description of FormPlainControlTest
24+
*
25+
* @author Michael Herold <quabla@hemio.de>
26+
*/
27+
class FormPlainControlTest extends \Helpers {
28+
29+
public function test1() {
30+
$form = new \hemio\form\FormPost('test');
31+
32+
$form->addInheritableAppendage(
33+
\hemio\form\FormPost::FORM_FIELD_TEMPLATE, new FormPlainControl()
34+
);
35+
36+
$form->addChild(new \hemio\form\FieldEmail('test1', 'title1'));
37+
38+
$form->__toString();
39+
}
40+
41+
}

0 commit comments

Comments
 (0)