links.php
The global base URI prefix for the application.
This variable is used to construct absolute URLs, ensuring the application functions correctly regardless of the subdirectory it is hosted in.
Table of Contents
Functions
- createLink() : string
- Generates an absolute URL by appending the global application prefix.
- createPublicLink() : string
- Generates a URL pointing to the public assets directory.
- createScriptLink() : string
- Generates a URL for a JavaScript file located in the scripts directory.
- createStylesLink() : string
- Generates a URL for a CSS stylesheet located in the styles directory.
- create_error_link() : string
- Generates a URL for the 500 internal server error page with a custom message.
- redirect_to() : void
- Performs an HTTP redirect to the specified URL and terminates the script.
- create_large_image_link() : string
- Generates a URL for a large version of an event image.
- create_small_image_link() : string
- Generates a URL for a thumbnail version of an event image.
- redirectToDatabaseError() : void
- Redirects the user to the standard database error page.
Functions
createLink()
Generates an absolute URL by appending the global application prefix.
createLink(string $link) : string
Parameters
- $link : string
-
The relative path (e.g., "/login.php").
Tags
Return values
string —The fully qualified URL.
createPublicLink()
Generates a URL pointing to the public assets directory.
createPublicLink(string $link) : string
Parameters
- $link : string
-
The relative path inside the public folder.
Return values
string —The full URL to the public resource.
createScriptLink()
Generates a URL for a JavaScript file located in the scripts directory.
createScriptLink(string $script) : string
Parameters
- $script : string
-
The filename of the script (e.g., "/app.js").
Return values
string —The full URL to the script file.
createStylesLink()
Generates a URL for a CSS stylesheet located in the styles directory.
createStylesLink(string $script) : string
Parameters
- $script : string
-
The filename of the stylesheet (e.g., "/main.css").
Return values
string —The full URL to the CSS file.
create_error_link()
Generates a URL for the 500 internal server error page with a custom message.
create_error_link(string $message) : string
Parameters
- $message : string
-
The error message to be passed in the query string.
Return values
string —The full URL to the error page.
redirect_to()
Performs an HTTP redirect to the specified URL and terminates the script.
redirect_to(string $link) : void
Parameters
- $link : string
-
The target URL for the redirection.
create_large_image_link()
Generates a URL for a large version of an event image.
create_large_image_link(string $imagname) : string
Parameters
- $imagname : string
-
The filename of the image.
Return values
string —The full URL to the large image.
create_small_image_link()
Generates a URL for a thumbnail version of an event image.
create_small_image_link(string $imagname) : string
Parameters
- $imagname : string
-
The filename of the image.
Return values
string —The full URL to the thumbnail image.
redirectToDatabaseError()
Redirects the user to the standard database error page.
redirectToDatabaseError() : void
This is a convenience wrapper around redirect_to() and create_error_link() specifically for handling database connection or query failures.