From 7a8b1f21cff0f821b03a95c29882a2057450dc26 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 30 Aug 2024 10:14:56 +0200 Subject: [PATCH] refactor: move HTML to template file Separated HTML content from index.php into templates/index.php for improved organization and maintainability. This change helps to keep business logic and presentation code separate, making the codebase easier to navigate and modify. --- index.php | 154 +------------------------------------------- templates/index.php | 150 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+), 151 deletions(-) create mode 100644 templates/index.php diff --git a/index.php b/index.php index 3f52fc9..25d63a3 100644 --- a/index.php +++ b/index.php @@ -103,155 +103,7 @@ foreach (array_reverse($preferred_currencies) as $currency) { array_unshift($currencies, $currency); } } -?> - - - - - - - - - - <?php echo $page_title; ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-

 XMR  

-
- - - "; - foreach ($chunk as $currency) { - $currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency; - echo ""; - } - echo ""; - echo ""; - foreach ($chunk as $currency) { - echo ""; - } - echo ""; - } - ?> - -
{$currency}
" . str_replace(".", ",", $exchangeRates[$currency]) . "
-
-
-
- -
-
- - - -
- -
- - - -
- -
- - - -
-
- - - -
- - - -
- - ' . $link['text'] . ' | '; - } - } - ?> - - - - -
- -
-
- - - - - \ No newline at end of file +// Output the HTML +require 'templates/index.php'; +?> \ No newline at end of file diff --git a/templates/index.php b/templates/index.php new file mode 100644 index 0000000..997cc41 --- /dev/null +++ b/templates/index.php @@ -0,0 +1,150 @@ + + + + + + + + + + <?php echo $page_title; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

 XMR  

+
+ + + "; + foreach ($chunk as $currency) { + $currencyName = isset(${"l_" . strtolower($currency)}) ? ${"l_" . strtolower($currency)} : $currency; + echo ""; + } + echo ""; + echo ""; + foreach ($chunk as $currency) { + echo ""; + } + echo ""; + } + ?> + +
{$currency}
" . str_replace(".", ",", $exchangeRates[$currency]) . "
+
+
+
+ +
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+
+ + + +
+ + + +
+ + ' . $link['text'] . ' | '; + } + } + ?> + + + + +
+ +
+
+ + + + + \ No newline at end of file