Globals


The TextSide Engine has a collection of global variables that can be accessed from within your code. This page lists all global variables that are available:

  • $siteRoot - Contains the url to the sites root, or home page. For example: "http://www.textside.com/". This variable can be used to create absolute Urls within pages.

  • $siteStatus - Contains an instance of siteStatus (core/main/siteStatus) that holds information about the current site status (current theme, default theme, whether setup has been run yet, etc.)

  • $siteUser - The current user that is logged in. This is a core/security/user class instance and contains all information about the current user. This includes username, first name, last name, email, and an encoded password.

  • $sql - A persistent sql connection that can be used to access the database. This provides access to an sql class (core/sql/sql.php) that can be used immediatly to run queries against the database. Note that the sql class can also be used to create connections to new databases, as well as provides utility methods to easily parse incoming data. For more information, please see the sql class reference.

  • $theme - The current theme that the site is using. Use this instance to resolve paths to the current selected themes folder.

  • $loginResult - Contains the result from a login attempt using the built in login form support. Please see Users and Security for information on using this global.

  • $registerResult - Contains the results from a register attempt using the built in register form support. Please see Users and Security for information on using this global.