Download for PHP  R515 (beta)
Welcome » Info pages » Contribute » Integrate

Input document


Upload document:


Taking advantage of UverseWiki text formatting is as simple as it can be – the framework has no dependencies besides PHP 5 and mbstring and only requires you to copy its files somewhere.

The most basic usage is just this:

Example 1.php
require 'uversewiki.php';
$s 'A **wiki** text.';
$doc UWikiDocument::TryParsing($s'wacko');
if (
$doc) { echo $doc->ToHTML(); }

«wacko» is the name of markup module that provides wiki support for our formatting. The above example will use default settings, i.e. loaded from UWikiRootPath/config/ but you can pass your own instance of UWikiSettings:

Example 2.php
require 'uversewiki.php';

$settings = new UWikiSettings;

$s 'A **wiki** text.';
$doc UWikiDocument::TryParsing($s$settings);
if (
$doc) { echo $doc->ToHTML(); }

When you use static parsing (TryParsing() method of UWikiDocument) exceptions are silented and null is returned when any occurs. However, to have more details and control over the process construct an instance of UWikiDocument and call its instance method Parse() instead:

Example 3.php
require 'uversewiki.php';

try {
$doc = new UWikiDocument('A **wiki** text.');

} catch (
EUverseWiki $e) {
'Error parsing or rendering the document!',
' Class 'get_class($e),
', message: '.$e->getMessage();

EUverseWiki is a common parent class for all UverseWiki exceptions.

Need help?

As of today the project has very sparse documentation and no API reference. However, you can expect our full support via the forum – just start a new topic there (either in English or Russian) and we will help you out.