text = $text; $this->text_is_html = $text_is_html; return $this; } /** * @return string The "raw form" of the text that shall be displayed. */ public function getText() : string { return $this->text; } /** * @return bool Whether the text is HTML (true) or not (false). */ public function isHtmlText() : bool { return $this->text_is_html; } /** * "Renders" the text: Either return it directly, if it is HTML or call htmlReady first before returning it. * * @return string The text that shall be placed in the form, either as HTML or plain text. */ public function render() { if ($this->text_is_html) { return $this->text; } else { return htmlReady($this->text); } } /** * @see Text::render() */ public function renderWithCondition() { return $this->render(); } }