diff options
author | Thedro Neely <thedroneely@gmail.com> | 2020-01-05 01:58:52 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2020-01-05 01:58:52 -0500 |
commit | 37c674cedb90a9e93ca4b84506f9fa0aa492aebc (patch) | |
tree | fd7e33a9372ab2bfbdac37f8e0c4f6254909f9ed /bootstrap | |
parent | d67d4c0351747554afcf42fa5df002b093d2c6d5 (diff) | |
download | thedroneely.com-37c674cedb90a9e93ca4b84506f9fa0aa492aebc.tar.gz thedroneely.com-37c674cedb90a9e93ca4b84506f9fa0aa492aebc.tar.bz2 thedroneely.com-37c674cedb90a9e93ca4b84506f9fa0aa492aebc.zip |
bootstrap/Bootstrap: Add new helpers
Diffstat (limited to 'bootstrap')
-rw-r--r-- | bootstrap/Bootstrap.php | 4 | ||||
-rw-r--r-- | bootstrap/Helpers.php (renamed from bootstrap/Functions.php) | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/bootstrap/Bootstrap.php b/bootstrap/Bootstrap.php index 8285bbe..c21d317 100644 --- a/bootstrap/Bootstrap.php +++ b/bootstrap/Bootstrap.php @@ -3,8 +3,8 @@ /* composer autoload */ require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/vendor/autoload.php'; -/* source functions */ -require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Functions.php'; +/* source helper functions */ +require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Helpers.php'; /* source config file */ $config = include $_SERVER['DOCUMENT_ROOT'] . '/..' . '/AppConfig.php'; diff --git a/bootstrap/Functions.php b/bootstrap/Helpers.php index 6e28cbc..e92f3ac 100644 --- a/bootstrap/Functions.php +++ b/bootstrap/Helpers.php @@ -4,11 +4,14 @@ * Helper Functions */ -function featherIcon(string $name) +function featherIcon(string $name, string $class = null) { - echo file_get_contents( - $_SERVER['DOCUMENT_ROOT'] - . '/..' . '/public/css/fonts/feather-icons/' . $name . '.svg' + return str_replace( + '<svg', '<svg class="' . $class . '" ', + file_get_contents( + $_SERVER['DOCUMENT_ROOT'] + . '/..' . '/public/css/fonts/feather-icons/' . $name . '.svg' + ) ); } @@ -19,6 +22,10 @@ function base64(string $path) ); } +function views(string $folder, string $name) +{ + return $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/' . $folder . '/' . $name .'.php'; +} function fetch(string $path, string $field) { |