Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:core:themerenderer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:core:themerenderer [2026/09/26 09:09] – admin adminscriptlog:lib:core:themerenderer [2026/09/26 09:34] (current) – admin admin
Line 32: Line 32:
 ======= Inheritance ======= ======= Inheritance =======
  
-  ^ Relation ^ Type ^ Meaning ^ +^ Relation ^ Type ^ Meaning ^ 
-  | implements | [[scriptlog:lib:core:themerendererinterface|''ThemeRendererInterface'']] | contract |+| implements | [[scriptlog:lib:core:themerendererinterface|''ThemeRendererInterface'']] | contract |
  
 ======= Constants (5) ======= ======= Constants (5) =======
  
-  ^ Visibility ^ Name ^ Value ^ Line ^ +^ Visibility ^ Name ^ Value ^ Line ^ 
-  | ''private'' | ''HEADER_TEMPLATE'' | '''header.php';'' | 36 | +| ''private'' | ''HEADER_TEMPLATE'' | '''header.php';'' | 36 | 
-  | ''private'' | ''FOOTER_TEMPLATE'' | '''footer.php';'' | 41 | +| ''private'' | ''FOOTER_TEMPLATE'' | '''footer.php';'' | 41 | 
-  | ''private'' | ''NOT_FOUND_TEMPLATE'' | '''404.php';'' | 46 | +| ''private'' | ''NOT_FOUND_TEMPLATE'' | '''404.php';'' | 46 | 
-  | ''private'' | ''TEMPLATE_EXTENSION'' | '''.php';'' | 51 | +| ''private'' | ''TEMPLATE_EXTENSION'' | '''.php';'' | 51 | 
-  | ''private'' | ''FALLBACK_THEME'' | '''blog';'' | 56 |+| ''private'' | ''FALLBACK_THEME'' | '''blog';'' | 56 |
  
-======= Properties (0) =======+======= Properties (2) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''private'' | ''string'' | ''$themeDir'' |  | 66 | 
 +| ''private'' | ''(untyped)'' | ''$errorLogger'' |  | 75 |
  
 ======= Methods (9) ======= ======= Methods (9) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | Construct a new ThemeRenderer. | 89 | +| public | ''__construct()'' | Construct a new ThemeRenderer. | 89 | 
-  | public static | ''fromGlobalContext()'' | Factory method that constructs a ThemeRenderer from global application context. | 117 | +| public static | ''fromGlobalContext()'' | Factory method that constructs a ThemeRenderer from global application context. | 117 | 
-  | public | ''render()'' | Render a full page: header, content template, and footer. | 135 | +| public | ''render()'' | Render a full page: header, content template, and footer. | 135 | 
-  | public | ''renderHeader()'' | Include the current theme's header template. | 146 | +| public | ''renderHeader()'' | Include the current theme's header template. | 146 | 
-  | public | ''renderContent()'' | Include a content template from the current theme directory. | 162 | +| public | ''renderContent()'' | Include a content template from the current theme directory. | 162 | 
-  | public | ''renderFooter()'' | Include the current theme's footer template. | 183 | +| public | ''renderFooter()'' | Include the current theme's footer template. | 183 | 
-  | public | ''render404()'' | Render a 404 response. | 199 | +| public | ''render404()'' | Render a 404 response. | 199 | 
-  | public | ''getThemeDir()'' | Return the resolved absolute path to the active theme directory. | 219 | +| public | ''getThemeDir()'' | Return the resolved absolute path to the active theme directory. | 219 | 
-  | private | ''log()'' | Log a message via the configured error logger, if one is set. | 229 |+| private | ''log()'' | Log a message via the configured error logger, if one is set. | 229 |
  
  
Line 72: Line 74:
 Construct a new ThemeRenderer. Construct a new ThemeRenderer.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$themesRootPath'' | ''string'' | //required// | Absolute path to the parent directory containing all theme directories, e.g. "/var/www/public/themes/". | +|  ''$themesRootPath'' |  ''string'' |  //required// |  Absolute path to the parent directory containing all theme directories, e.g. "/var/www/public/themes/". | 
-  | ''$themeName'' | ''string'' | //required// | Name of the active theme directory (sanitized with {@see basename()}). | +|  ''$themeName'' |  ''string'' |  //required// |  Name of the active theme directory (sanitized with {@see basename()}). | 
-  | ''$errorLogger'' | ''?callable'' | ''null'' | Optional error logger. | +|  ''$errorLogger'' |  ''?callable'' |  ''null'' |  Optional error logger. | 
-  | ''$fallbackTheme'' | ''string'' | '''blog''' | Fallback theme name when the primary theme is missing required templates. |+|  ''$fallbackTheme'' |  ''string'' |  '''blog''' |  Fallback theme name when the primary theme is missing required templates. |
  
  
Line 112: Line 114:
 Sets the HTTP response code before any output is sent. Sets the HTTP response code before any output is sent.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$template'' | ''string'' | //required// | Content template name (without .php extension). | +|  ''$template'' |  ''string'' |  //required// |  Content template name (without .php extension). | 
-  | ''$statusCode'' | ''int'' | ''200'' | HTTP status code (default 200). |+|  ''$statusCode'' |  ''int'' |  ''200'' |  HTTP status code (default 200). |
  
 **Returns:** ''void'' **Returns:** ''void''
Line 154: Line 156:
 to prevent directory traversal attacks. to prevent directory traversal attacks.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$template'' | ''string'' | //required// | Content template name (without .php extension). |+|  ''$template'' |  ''string'' |  //required// |  Content template name (without .php extension). |
  
 **Returns:** ''void'' **Returns:** ''void''
Line 227: Line 229:
 Log a message via the configured error logger, if one is set. Log a message via the configured error logger, if one is set.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$message'' | ''string'' | //required// | The log message. |+|  ''$message'' |  ''string'' |  //required// |  The log message. |
  
 **Returns:** ''void'' **Returns:** ''void''
scriptlog/lib/core/themerenderer.1790413762.txt.gz · Last modified: by admin