Beispiel #1
0
 function __construct()
 {
     Bella::loadPackage('xamin/handlebars.php/src/Handlebars/Autoloader.php');
     Handlebars\Autoloader::register();
     $this->engine = new Handlebars\Handlebars();
     $config = Config::get('settings');
     $header = Config::get('application');
     $this->data['header'] = (object) $header;
     $this->data['textData'] = (object) [];
     $this->data['scriptData'] = (object) [];
     $this->data['meta'] = (object) ['server' => Config::get('server'), 'domain' => Config::get('domain'), 'home' => '//' . $_SERVER['SERVER_NAME'] . $config->baseDir, 'baseDir' => $config->baseDir, 'tracking' => $config->tracking];
     $this->setTemplate('default');
     $this->setLayout('default');
 }
 public function setUp()
 {
     \Handlebars\Autoloader::register();
 }
Beispiel #3
0
            fputcsv($out, Set::flatten($row));
        }
    }
    fclose($out);
    header(sprintf('Content-Disposition: attachment; filename="%s"', $name));
    return ob_get_clean();
}));
// Libraries::add('Handlebars', array(
//     // "prefix" => "Handlebars_",
//     // "includePath" => LITHIUM_LIBRARY_PATH, // or LITHIUM_APP_PATH . '/libraries'
//     // "bootstrap" => "Loader/Autoloader.php",
//     // "loader" => array("Handlebars", "register"),
//     // "transform" => function($class) { return str_replace("_", "/", $class) . ".php"; }
// ));
require RADIUM_PATH . '/libraries/Handlebars/Autoloader.php';
Autoloader::register();
/*
 * this filter allows automatic linking and loading of assets from `webroot` folder
 */
Dispatcher::applyFilter('_callable', function ($self, $params, $chain) {
    list($library, $asset) = explode('/', ltrim($params['request']->url, '/'), 2) + array("", "");
    if ($asset && $library == 'radium' && ($path = Media::webroot($library)) && file_exists($file = "{$path}/{$asset}")) {
        return function () use($file) {
            $info = pathinfo($file);
            $media = Media::type($info['extension']);
            $content = (array) $media['content'];
            return new Response(array('headers' => array('Content-type' => reset($content)), 'body' => file_get_contents($file)));
        };
    }
    return $chain->next($self, $params, $chain);
});
 public function __construct()
 {
     \Handlebars\Autoloader::register();
 }
 protected function __construct()
 {
     \Handlebars\Autoloader::register();
 }