SUIT Framework

Scripting Using Integrated Templates

Try It - Templating

12/27/2015: SUIT Framework is no longer actively maintained.

Our Try It Editor can be used to play around with some Rulesets live on this site. Learn more about it on its Docs article.


Brandon's Site - Examples

Welcome, Brandon! The current time is: 08/24/2019 02:18:42

My File
<p>Welcome, [var]username[/var]!</p>

An exception was caught: No such file or directory

<h1>Brandon's Site - Examples</h1>
<p>Welcome, Brandon! The current time is: 08/24/2019 02:18:42</p>
    <legend>My File</legend>
    <div class="highlight"><pre><span class="nt"><p></span>Welcome, [var]username[/var]!<span class="nt"></p></span>
<p>An exception was caught: No such file or directory</p>


Entities Insensitive Line Break Log Mismatched Unclosed


class Helpers
    public function currenttime()
        return date('m/d/Y H:M:S');

    public function pygments($params)
        SUIT's Try It Editor is powered by Python, and the PHP examples
        attempt to show the equivalent of the Python code. However, there is no
        PHP version of Pygments, so we'll just revert back to the text version.
        return '<pre>' . htmlentities($params['string']) . '</pre>';

$templating->var->username = 'Brandon';
$templating->var->loggedin = true;
$templating->var->members = array
        'name' => 'Brandon',
        'admin' => true,
        'banned' => false
        'name' => 'Chris',
        'admin' => false,
        'banned' => true
$templating->var->owner = 'Brandon';
$templating->var->ownerfull = 'Brandon Evans';
from rulebox.templating import var
from suitframework.lib import helperstry

def currenttime():
    import time
    return time.strftime('%m/%d/%Y %H:%M:%S', time.localtime())

def pygments(lexer, string):
    from pygments import highlight
    from pygments.lexers import get_lexer_by_name
    from pygments.formatters import HtmlFormatter
    return highlight(string, get_lexer_by_name(lexer), HtmlFormatter())

helperstry.currenttime = currenttime
var.username = 'Brandon'
var.loggedin = True
var.members = [
        'name': 'Brandon',
        'admin': True,
        'banned': False
        'name': 'Chris',
        'admin': False,
        'banned': True
var.owner = 'Brandon'
var.ownerfull = 'Brandon Evans'
<h1>[var]owner[/var]'s Site - [var]title[/var]</h1>
<hr />
<p>Copyright &copy; 20XX [var]ownerfull[/var].</p>