Código
<?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
Código
<?php class Templates { public static function show($theme, $file_html, $lang) { $file = $_SERVER['DOCUMENT_ROOT'] . '/Templates/' . $theme . '/' . $file_html . '.html'; foreach ($lang as $key => $value) { } echo $html; } } $templates = new Templates(); ?>