1. Core.php
<?php
class Core {
public $MySQLi;
public $instance;
public static function getInstance() {
static $instance = null;
if($instance == null) {
$instance = new Core();
}
return $instance;
}
private function __construct() {
require $_SERVER['DOCUMENT_ROOT'] . '/Core/Configuration.php';
$this->MySQLi = new MySQLi($host, $user, $pass, $db);
if ($this->MySQLi->connect_error) {
echo 'ERROR MySQLi';
}
}
private function __destruct() {
$this->MySQLi->close();
}
}
$heart = Core::getInstance();
?>
2. Templates.php
<?php
class Templates {
public static function show($theme, $file_html, $lang) {
$file = $_SERVER['DOCUMENT_ROOT'] . '/Templates/' . $theme . '/' . $file_html . '.html';
$open = fopen($file, 'r');
$html = fread($open, filesize($file));
foreach ($lang as $key => $value) {
$html = str_replace('%' . $key . '%', $value, $html);
}
echo $html;
}
}
$templates = new Templates();
?>
Veo que tienes un core y una vista... podrías usar directamente codeigniter y así si vendes el proyecto o se te une alguien será un punto a tu favor...