aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/PicoFarad/Template.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2014-07-12 16:39:31 +0200
committerNicolas Lœuillet <nicolas@loeuillet.org>2014-07-12 16:39:31 +0200
commit26b77483ee7545c0e4f8eeb205a5743bf3589adb (patch)
tree4a1da42493bcf2f16ef6373d7955dad5ff5eda45 /inc/3rdparty/PicoFarad/Template.php
parentb3cda72e93fff3a4c3476e9e7e78ef2b2a3f02b9 (diff)
downloadwallabag-26b77483ee7545c0e4f8eeb205a5743bf3589adb.tar.gz
wallabag-26b77483ee7545c0e4f8eeb205a5743bf3589adb.tar.zst
wallabag-26b77483ee7545c0e4f8eeb205a5743bf3589adb.zip
remove PicoFarad
I’ll implement it an other day.
Diffstat (limited to 'inc/3rdparty/PicoFarad/Template.php')
-rw-r--r--inc/3rdparty/PicoFarad/Template.php36
1 files changed, 0 insertions, 36 deletions
diff --git a/inc/3rdparty/PicoFarad/Template.php b/inc/3rdparty/PicoFarad/Template.php
deleted file mode 100644
index c32be309..00000000
--- a/inc/3rdparty/PicoFarad/Template.php
+++ /dev/null
@@ -1,36 +0,0 @@
1<?php
2
3namespace PicoFarad\Template;
4
5const PATH = 'templates/';
6
7// Template\load('template_name', ['bla' => 'value']);
8function load()
9{
10 if (func_num_args() < 1 || func_num_args() > 2) {
11 die('Invalid template arguments');
12 }
13
14 if (! file_exists(PATH.func_get_arg(0).'.php')) {
15 die('Unable to load the template: "'.func_get_arg(0).'"');
16 }
17
18 if (func_num_args() === 2) {
19
20 if (! is_array(func_get_arg(1))) {
21 die('Template variables must be an array');
22 }
23
24 extract(func_get_arg(1));
25 }
26
27 ob_start();
28 include PATH.func_get_arg(0).'.php';
29 return ob_get_clean();
30}
31
32
33function layout($template_name, array $template_args = array(), $layout_name = 'layout')
34{
35 return load($layout_name, $template_args + array('content_for_layout' => load($template_name, $template_args)));
36}