Skip to content

Commit 8aaaa73

Browse files
committed
layout: render_static for all layouts
1 parent e85e3ff commit 8aaaa73

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

CHANGELOG.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
## 1.1.1
1+
# 1.2.0 (2016-05-30)
2+
3+
## Breaking changes
4+
5+
- Layout classes must now implement `render_static`.
6+
7+
## Bugfixes
28

3-
Bugfixes:
49
- Unbuffered output regression fix since 1.1.0
10+
- Support static fields for all layouts.
511

6-
## 1.1.0
12+
# 1.1.0 (2016-05-29)
13+
14+
## Breaking changes
715

8-
Breaking changes:
916
- Layout classes must now implement `preamble` and `postamble` functions.
1017
- Layout classes must now implement `render_hidden` function.
1118

12-
Bugfixes:
19+
## Bugfixes
20+
1321
- Fixed layout being instance instead of string.
1422

15-
Features:
23+
## Features
24+
1625
- Supports additional HTTP methods (PATCH, DELETE, etc).
1726
- Support customizing `<form>` wrapper using `preamble` and `postamble`.

src/lib/FormLayout.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public function render_hidden($field);
1010
public function render_field($field, $error);
1111
public function render_fieldset($fieldset);
1212
public function render_hint($field);
13+
public function render_static($field);
1314
public function begin();
1415
public function end();
1516

src/lib/FormLayoutPlain.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public function render_hint($field){
2020
$this->render_field($field, false);
2121
}
2222

23+
public function render_static($field){
24+
$this->render_field($field, false);
25+
}
26+
2327
public function render_group($group, $res){
2428
$label = $group->get_label();
2529

src/lib/FormLayoutTable.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public function render_hint($field){
7878
$this->render_field($field, false);
7979
}
8080

81+
public function render_static($field){
82+
$this->render_field($field, false);
83+
}
84+
8185
public function begin(){
8286
$this->closed = false;
8387
echo " <table class=\"layout\">\n";

tests/MockForm.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public function render_hint($field){
3434

3535
}
3636

37+
public function render_static($field){
38+
$this->field[$field->get_name()] = $field;
39+
}
40+
3741
public function begin(){
3842

3943
}

0 commit comments

Comments
 (0)