Files
SBBCodeParser/classes/Node/Text.php
Christian Rank 22d129fcfa Cleaned up code
Using a Namespace and a seperate File for each Class in a good structure
2013-07-07 16:00:48 +02:00

27 lines
476 B
PHP

<?php
namespace SBBCodeParser;
class Node_Text extends Node
{
protected $text;
public function __construct($text)
{
$this->text = $text;
}
public function get_html($nl2br=true)
{
if(!$nl2br)
return str_replace(" ", " &nbsp;", htmlentities($this->text, ENT_QUOTES | ENT_IGNORE, "UTF-8"));
return str_replace(" ", " &nbsp;", nl2br(htmlentities($this->text, ENT_QUOTES | ENT_IGNORE, "UTF-8")));
}
public function get_text()
{
return $this->text;
}
}