Variables and Functions
Lists of variables, classes, functions, constants, and so on defined by HS-CMS are listed below, but first, we discuss conventions.
Global variables, classes, and functions tend to follow these conventions:
- Start with
HS_and then follow normal conventions:
- Most variables and keys are
capitalizedLikeThis(except for the pseudo-namespace) — ex:
- Variables and array keys whose names are taken from database fields
capitalized_like_this, just like the database column names. ex:
capitalized_like_this()— if the typing underscores bothers you, consider typing with Dvorak (I’m half serious).
- Global constants are really members of a global array variable
Global Variables, Arrays, Objects, and Constants (not classes)
The current installation root, containing “sites,” “doc,” “core,” “filters,” and the other directories. This variable is defined like this in page.php:
and is thus available to every file except for config_installation.php. (If that’s a problem, contact Alan Hogan and complain, but it shouldn’t be one.)
String with the path to the current site’s directory, including the trailing slash. Example value:
/path/to/hs-cms/example/. Example usage:
String with the current request URI without beginning or trailing slashes (except for the root,
in which case this variable holds just a slash,
'/') and without any GET variables.
Browser address: http://example.com/some/page/?foo&bar=1 $_ENV['REQUEST_URI']: /some/page/?foo&bar=1 HS_requestUrl: some/page
An array available to render engines. It’s based on the original page information in the database, but by the time it reaches the render engine, it’s no longer just the raw data. Details follow.
This array has the following keys:
When applying formatting and cache, this is somewhere between the original, unformatted (e.g. still Markdown) content and the final XHTML (assuming you are outputting XHTML).
By the time it’s in the rendering engine, it’s the final product, ready to
print()into the document.
String, content title, plaintext (entities need encoded by render engine).
Description, appropriate for being displayed in a list of pages and for inclusion in the pages’s
data. Still plaintext (entities need encoded by render engine).
Other keys are exactly as defined here.
…are there any?…