generate titles and a links
authorEduardo <[email protected]>
Mon, 6 Nov 2023 22:10:16 +0000 (23:10 +0100)
committerEduardo <[email protected]>
Mon, 6 Nov 2023 22:10:16 +0000 (23:10 +0100)
page-generator/generator.php

index 9be2709b5e05216a590bcbd7691639dc740c7f4c..15a724e7c50fa7fd71d9e932c6724cfc759ed74b 100644 (file)
@@ -78,4 +78,20 @@ class CodeGenerator
         $content = str_replace($replaceVar, $value, $content);
         file_put_contents($filePath, $content, LOCK_EX);
     }
+
+    function spanTitle(string $title, string $text): string
+    {
+        return "<span title='$title'>$text</span> ";
+    }
+
+    function a(string $url, string $text, string $title = null): string
+    {
+        $str = "<a href='$url'";
+        if (!is_null($title)) {
+            $str .= " title'$title'";
+        }
+        $str .= ">$text</a> ";
+
+        return $str;
+    }
 }