Exemplo n.º 1
0
function _p2p_load_admin()
{
    P2P_Autoload::register('P2P_', dirname(__FILE__) . '/admin');
    P2P_Mustache::init();
    new P2P_Box_Factory();
    new P2P_Column_Factory();
    new P2P_Dropdown_Factory();
    new P2P_Tools_Page();
}
Exemplo n.º 2
0
<?php

/**
 * @internal
 */
abstract class P2P_Mustache
{
    private static $loader;
    private static $mustache;
    public static function init()
    {
        if (!class_exists('Mustache')) {
            require dirname(__FILE__) . '/../mustache/Mustache.php';
        }
        if (!class_exists('MustacheLoader')) {
            require dirname(__FILE__) . '/../mustache/MustacheLoader.php';
        }
        self::$loader = new MustacheLoader(dirname(__FILE__) . '/templates', 'html');
        self::$mustache = new Mustache(null, null, self::$loader);
    }
    public static function render($template, $data)
    {
        return self::$mustache->render(self::$loader[$template], $data);
    }
}
P2P_Mustache::init();