Theme loader

This commit is contained in:
Roman Shvets 2013-08-28 15:18:01 +03:00
parent 516a53f248
commit 5943454877
2 changed files with 6 additions and 0 deletions

View file

@ -6,6 +6,7 @@
* [New] Ignore Emacs and Nano tmp files like: "~", "#"; in content folder
* [New] Ignore hidden files in content folder
* [Fixed] - empty title/date headers
* [Fixed] - Error handling on wrong theme name
2013.05.07 - version 0.6.2
* [Changed] Replaced glob_recursive with get_files

View file

@ -79,6 +79,11 @@ class Pico {
// Load the theme
$this->run_hooks('before_twig_register');
Twig_Autoloader::register();
if(!is_dir(THEMES_DIR . $settings['theme'])) {
die(sprintf("Can't open defined theme: %s in dir %s", $settings['theme'], THEMES_DIR));
}
$loader = new Twig_Loader_Filesystem(THEMES_DIR . $settings['theme']);
$twig = new Twig_Environment($loader, $settings['twig_config']);
$twig->addExtension(new Twig_Extension_Debug());