This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_sakura/components/BBcode/BBcode.php
flashwave ffa83320d2 r20151125
Signed-off-by: Flashwave <me@flash.moe>
2015-11-25 21:18:52 +01:00

52 lines
880 B
PHP

<?php
/*
* BBcode main
*/
namespace Sakura\BBcode;
class BBcode
{
// Text
private $text;
private $seed;
// Contructor
public function __construct($text = "", $seed = '9001')
{
$this->setText($text);
$this->seed = $seed;
}
// Set text
public function setText($text)
{
$this->text = $text;
}
// Convert to storage format
public function toStore()
{
// Create new Store
$store = new Store($this->text, $this->seed);
// Parse
$store = $store->generate();
// And return
return $store;
}
// Convert to storage format
public function toHTML()
{
// Create new Parse
$parse = new Parse($this->text, $this->seed);
// Parse
$parse = $parse->parse();
// And return
return $parse;
}
}