예제 #1
0
파일: View.php 프로젝트: ndaidong/bella.php
 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');
 }
예제 #2
0
 public function setUp()
 {
     \Handlebars\Autoloader::register();
 }
예제 #3
0
파일: media.php 프로젝트: bruensicke/radium
            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);
});
예제 #4
0
 public function __construct()
 {
     \Handlebars\Autoloader::register();
 }
예제 #5
0
 protected function __construct()
 {
     \Handlebars\Autoloader::register();
 }