Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JPustkuchen committed May 10, 2021
1 parent c4a0276 commit 9eeabfa
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/Elements/TableCell.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ class TableCell extends HtmlEntity {
*/
private ?string $value;

/**
* Raw content to prepend to value.
* Use with care and not for user input!
* This will not be auto-escaped!
*/
private string $beforeValueRaw;

/**
* Raw content to append to value.
* Use with care and not for user input!
* This will not be auto-escaped!
*/
private string $afterValueRaw;


public function __construct(string $key, ?string $value = null, ?HtmlAttributes $attributes = null) {
$this->key = $key;
$this->value = $value;
Expand Down Expand Up @@ -67,9 +82,55 @@ public function toArray() {
$result = [
'key' => $this->key,
'value' => $this->value,
'beforeValueRaw' => $this->beforeValueRaw,
'afterValueRaw' => $this->afterValueRaw,
'attributes' => $this->getAttributes()->toString(),
];

return $result;
}

/**
* Get raw content to append to value.
* Use with care and not for user input!
* This will not be auto-escaped!
*/
public function getAfterValueRaw() {
return $this->afterValueRaw;
}

/**
* Set raw content to append to value.
* Use with care and not for user input!
* This will not be auto-escaped!
*
* @return self
*/
public function setAfterValueRaw($afterValueRaw) {
$this->afterValueRaw = $afterValueRaw;

return $this;
}

/**
* Get raw content to prepend to value.
* Use with care and not for user input!
* This will not be auto-escaped!
*/
public function getBeforeValueRaw() {
return $this->beforeValueRaw;
}

/**
* Set raw content to prepend to value.
* Use with care and not for user input!
* This will not be auto-escaped!
*
* @return self
*/
public function setBeforeValueRaw($beforeValueRaw) {
$this->beforeValueRaw = $beforeValueRaw;

return $this;
}
}

0 comments on commit 9eeabfa

Please sign in to comment.