public function called() { $config = new \Dreamcoil\Config(); $title = new \Dreamcoil\Codebowl\Title(); $auth = new \Dreamcoil\Auth(); $title->set($config->get('title')); $title->append('Home'); $layout = new \Dreamcoil\Layout('Bubo', array('title' => $title->get(), 'time' => time())); echo "We're going to miss you Dreamcoil v1<hr>"; \Models\UserModel::getData(); $auth->set(array('Name' => 'Florian')); if ($auth->check()) { echo '<br>Welcome!</br>'; } }
/** * Gets the translation for a translation key * * @param $key * @param null $lang * @return string */ public function get($key, $lang = null) { $config = new \Dreamcoil\Config(); $key = explode('.', $key); $fallback = $config->get('fallback_lang'); if ($lang === null) { if (!file_exists(__DIR__ . '/../files/Translations/' . $fallback . '/' . $key[0] . '.php')) { return implode('.', $key); } $lang = (include __DIR__ . '/../files/Translations/' . $fallback . '/' . $key[0] . '.php'); if (isset($lang[$key[1]])) { return $lang[$key[1]]; } return implode('.', $key); } if (!file_exists(__DIR__ . '/../files/Translations/' . $lang . '/' . $key[0] . '.php')) { return implode('.', $key); } $lang = (include __DIR__ . '/../files/Translations/' . $lang . '/' . $key[0] . '.php'); if (isset($lang[$key[1]])) { return str_replace(['ü', 'ö', 'ä', 'Ü', 'Ö', 'Ä', 'ß'], ['ü', 'ö', 'ä', 'Ü', 'Ö', 'Ä', 'ß'], $lang[$key[1]]); } return implode('.', $key); }