-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
just adding all the files so i can work from laptop
- Loading branch information
1 parent
4b8d842
commit 758c19c
Showing
7 changed files
with
89 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
class Template { | ||
private $data = array(); | ||
|
||
public function __construct($driver) { | ||
$class = 'Template\\' . $driver; | ||
|
||
if (class_exists($class)) { | ||
$this->template = new $class($expire); | ||
} else { | ||
exit('Error: Could not load template driver ' . $driver . ' cache!'); | ||
} | ||
} | ||
|
||
public function set($key, $value) { | ||
$this->data[$key] = $value; | ||
} | ||
|
||
public function render() { | ||
$file = DIR_TEMPLATE . $template; | ||
|
||
if (file_exists($file)) { | ||
extract($data); | ||
|
||
ob_start(); | ||
|
||
require($file); | ||
|
||
$output = ob_get_contents(); | ||
|
||
ob_end_clean(); | ||
|
||
return $output; | ||
} else { | ||
trigger_error('Error: Could not load template ' . $file . '!'); | ||
exit(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
class Template { | ||
private $data = array(); | ||
|
||
public function set($key, $value) { | ||
$this->data[$key] = $value; | ||
} | ||
|
||
public function render() { | ||
$file = DIR_TEMPLATE . $template; | ||
|
||
if (file_exists($file)) { | ||
extract($data); | ||
|
||
ob_start(); | ||
|
||
require($file); | ||
|
||
$output = ob_get_contents(); | ||
|
||
ob_end_clean(); | ||
|
||
return $output; | ||
} else { | ||
trigger_error('Error: Could not load template ' . $file . '!'); | ||
exit(); | ||
} | ||
} | ||
} |