diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-12-22 03:45:39 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-12-22 03:45:39 -0500 |
commit | 00e758ec48e4aeea7fbd109477304cb709ad1688 (patch) | |
tree | 1d6caeab55694dabe041ff33d9bc3a35d5d856b0 /bootstrap | |
parent | 4a7d4653a176c61b0ba07f87ecb5549f1e3b426c (diff) | |
download | thedroneely.com-00e758ec48e4aeea7fbd109477304cb709ad1688.tar.gz thedroneely.com-00e758ec48e4aeea7fbd109477304cb709ad1688.tar.bz2 thedroneely.com-00e758ec48e4aeea7fbd109477304cb709ad1688.zip |
app/views/index: Move introduction to singleton
Diffstat (limited to 'bootstrap')
-rw-r--r-- | bootstrap/Functions.php | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/bootstrap/Functions.php b/bootstrap/Functions.php index 252b522..a515402 100644 --- a/bootstrap/Functions.php +++ b/bootstrap/Functions.php @@ -4,17 +4,29 @@ * Helper Functions */ -function featherIcon($name) { - echo file_get_contents( - $_SERVER['DOCUMENT_ROOT'] - . '/..' . '/public/css/fonts/feather-icons/' . $name . '.svg' - ); +function featherIcon(string $name) +{ + echo file_get_contents( + $_SERVER['DOCUMENT_ROOT'] + . '/..' . '/public/css/fonts/feather-icons/' . $name . '.svg' + ); } -function base64($path) { - echo base64_encode( - file_get_contents($_SERVER['DOCUMENT_ROOT'] - . '/..' . $path - ) - ); +function base64(string $path) +{ + echo base64_encode( + file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/..' . $path) + ); +} + + +function fetch(string $path, string $field) +{ + $config = include $_SERVER['DOCUMENT_ROOT'] . '/..' . '/AppConfig.php';; + $json = file_get_contents( + 'http://' . $_SERVER['SERVER_NAME'] + . $path . '?token=' . $config['cms']['token'] + ); + $data = json_decode($json, true); + echo $data[$field]; } |