documented functions
authorEduardo <[email protected]>
Fri, 10 Nov 2023 13:34:10 +0000 (14:34 +0100)
committerEduardo <[email protected]>
Fri, 10 Nov 2023 13:34:10 +0000 (14:34 +0100)
page-generator/generator.php

index c7e5f3a3a811e1f77b72f2da3d0667cd6fe196c2..abaf48328359f263120c74d20318260bafb3ee7f 100644 (file)
@@ -44,6 +44,9 @@ class CodeGenerator
         }
     }
 
+    /**
+     * Create a folder structure for a given list of pages
+     */
     function generateFoldersForPages(array $folderList, $basePath)
     {
         foreach ($folderList as $folder) {
@@ -73,6 +76,9 @@ class CodeGenerator
         return "$$" . $name . "$$";
     }
 
+    /**
+     * Replace a template variable with a given value
+     */
     function setTemplateVar(string $filePath, string $var, string $value)
     {
         $replaceVar = "$$" . $var . "$$";
@@ -82,11 +88,17 @@ class CodeGenerator
         file_put_contents($filePath, $content, LOCK_EX);
     }
 
+    /**
+     * Returns a string with a span tag with a title set
+     */
     function spanTitle(string $title, string $text): string
     {
         return "<span title='$title'>$text</span> ";
     }
 
+    /**
+     * Returns a string with an anchor tag
+     */
     function a(string $url, string $text, string $title = null): string
     {
         $str = "<a href='$url'";