public function templates() { Template::addPath('lowpriority', '', -5); Template::addPath('regularpriority', '', 0); Template::addPath('highpriority', '', 5); return Response::table(Template::getPaths()); }
/** * Set template paths, config vars, etc * @param string $routepath The prefix that should be added to all route paths. * @return void */ public function initialize($routepath) { // Set path $this->routepath = $routepath; // Add templates Template::addPath(__DIR__ . '/../templates/', 'CatLab/OAuth2/'); Application::getInstance()->on('dispatch:before', array($this, 'setRequestUser')); // Add locales Text::getInstance()->addPath('catlab.oauth2', __DIR__ . '/locales/'); $this->setErrorResponder(new JSON()); }
/** * Set template paths, config vars, etc * @param string $routepath The prefix that should be added to all route paths. * @return void */ public function initialize($routepath) { $this->routepath = $routepath; Template::addPath(__DIR__ . '/templates/', 'CatLab/OpenIDClient/'); // Set session variable Application::getInstance()->on('dispatch:before', array($this, 'setRequestUser')); // Set the global user mapper, unless one is set already Application::getInstance()->on('dispatch:first', array($this, 'setUserMapper')); // Add helper methods $helper = new LoginForm($this); Template::addHelper('CatLab.OpenIDClient.LoginForm', $helper); }
/** * Set template paths, config vars, etc * @param string $routepath The prefix that should be added to all route paths. * @return void */ public function initialize($routepath) { // Set path $this->routepath = $routepath; // Add templates Template::addPath(__DIR__ . '/templates/', 'CatLab/Accounts/'); // Add locales Text::getInstance()->addPath('catlab.accounts', __DIR__ . '/locales/'); // Set session variable Application::getInstance()->on('dispatch:before', array($this, 'setRequestUser')); // Set the global user mapper, unless one is set already Application::getInstance()->on('dispatch:first', array($this, 'setUserMapper')); // Add helper methods $helper = new LoginForm($this); Template::addHelper('CatLab.Accounts.LoginForm', $helper); }
/** * */ private function __construct() { Template::addPath(dirname(dirname(__FILE__)) . '/templates/', '', -1); }
<?php error_reporting(E_ALL); $loader = (require_once '../../vendor/autoload.php'); // Start the app $app = \Neuron\Application::getInstance(); // Set config folder \Neuron\Config::folder(__DIR__ . '/../config/'); // Optionally, set an environment $hostname = trim(file_get_contents('/etc/hostname')); switch ($hostname) { case 'my-computer': case 'thijs-home-i7': case 'thijs-i7': \Neuron\Config::environment('development'); break; } // Set the template folder \Neuron\Core\Template::addPath(__DIR__ . '/../templates/'); // Always set a locale $app->setLocale('nl_BE.utf8'); // Load the router $app->setRouter(include 'router.php'); // Return app return $app;