-
Notifications
You must be signed in to change notification settings - Fork 9
/
blitz.class.php
54 lines (46 loc) · 1.26 KB
/
blitz.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**************************************************************************/
/* Quicky: smart and fast templates
/* ver. 0.5.0.0
/* http://code.google.com/p/quicky/
/* ===========================
/*
/* blitz.class.php: blitz-compatible API
/**************************************************************************/
require_once dirname(__FILE__) . '/Quicky.class.php';
class Blitz extends Quicky {
public $tplname;
public $parsed = false;
public function __construct($tpl) {
$this->init();
$this->tplname = $tpl;
}
public function _fetch($name) {
if (!$this->parsed) {
$this->parse(true);
}
return $this->context_fetch($name);
}
public function set($value = array()) {
return $this->context_set($value);
}
public function iterate($name = '') {
return $this->context_iterate($name);
}
public function context($path) {
return $this->context_path($path);
}
public function parse($fetch = false, $vars = array()) {
$this->parsed = true;
if ($fetch) {
return $this->fetch($this->tplname);
}
return $this->display($this->tplname);
}
public function load($string) {
$this->load_string($tpl->tplname = dechex(abs(crc32($string))), $string);
}
function escape($string) {
return htmlspecialchars($string, ENT_QUOTES);
}
}