Skip to content

Commit 8baaf63

Browse files
committed
Make methods chainable
1 parent e67f096 commit 8baaf63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/WebApp/Renderer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function getClass() {
3131

3232
public function addClass($class) {
3333
$this->addAttribute('class', $class);
34+
return $this;
3435
}
3536

3637
public function removeClass($class) {
@@ -54,6 +55,7 @@ public function setStyle($name, $value) {
5455
} else {
5556
unset($this->styles[$name]);
5657
}
58+
return $this;
5759
}
5860

5961
protected function getAttribute($name, $combined = FALSE) {
@@ -112,6 +114,7 @@ public function addAttribute($name, $value) {
112114
if (!isset($this->attributes[$name])) $this->attributes[$name] = array();
113115
$this->attributes[$name][] = $value;
114116
}
117+
return $this;
115118
}
116119

117120
public function setAttribute($name, $value) {
@@ -120,6 +123,7 @@ public function setAttribute($name, $value) {
120123
} else {
121124
unset($this->attributes[$name]);
122125
}
126+
return $this;
123127
}
124128

125129
public function removeAttribute($name, $value) {

0 commit comments

Comments
 (0)