Manual and Documentation

NOTE: This manual describes HammerKit version 3.5. To view documentation for the current release of HammerKit Studio, please go to http://manual.hammerkit.com/
search
Index / E. HammerScript / Constructors and variable scopes

A. Introduction
B. Installation and Configuration
C. Using HammerKit tools
D. Object API
E. HammerScript
Introduction
Syntax
Constructors and variable scopes
System variables
Try it
F. Access Rights
Constructors and variable scopes


Constructors of classes with only one instance (singletons)

These constructors don't need an identifier argument, because there exists only one instance of the class at one time.

Constructor
Description
cgi
This is an alias for the request variable scope.
config This variable scope contains the configuration preferences for the site.

A list of all configuration preferences can be found in section XYZ: Site configuration preferences.
cookie
This variable scope contains the variables of the PHP $_COOKIE array.
env
This variable scope contains the variables of the PHP $_ENV  array.

For further information on the variables contained in the $_ENV array see the PHP manual on the subject.
get
This variable scope contains the variables of the PHP $_GET array. Usually the variables passed in the request URL.
global Global variables in PHP.

NOTE! This variable scope should not be used for users' own variables. Instead use variable scope var for that purpose.
post
This variable scope contains the variables of the PHP $_POST array. Usually the variables passed in the request from an HTML form.
private
The private variable scope is private to one component runtime instance. This means that a variable in the private scope exists only in the component runtime instance where it was set. The variable is not visible and cannot be accesses from outside that component runtime instance.
request
This variable scope contains all the variables originating from the PHP $_POST, $_GET and $_COOKIE arrays, that is all URL parameters, variables posted in forms and variables stored in cookies.
server
This variable scope contains the variables of the PHP $_SERVER array.

For further information on the variables contained in the $_SERVER array see the PHP manual on the subject.
sessionThis variable scope contains all the variables of the current session.

A full list of all the session variables can be found in section XYZ: Session variables.
system
System variables like the HammerKit, PHP and database versions, system time and so on. A complete list of the system variables can be found here.
var
A variable scope for users' own variables. This variable scope is empty by default.

Constructors of classes with many instances

Constructor
Description
component
The unique attribute of this class is id.

Shortcut identifiers:
- listedComponent: the currently listed component
- previousPage: the previously loaded page
- thisComponent: the component in which the HammerScript is parsed
- thisPage: the current loaded page, same as cgi.article_id
- usedComponent: the component most recently marked as used
- userComponent: the currently logged-in user's component, shortcut to user(thisUser).page
file
The unique attributes of this class are id, path and url.
table
The unique attributes of this class are id and name.
user
The unique attributes of this class are id and username.

Shortcut identifiers:
- thisUser: the currenlty logged-in user, same as session.user_id
usergroup
The unique attribute of this class is id.


Example: print a welcome text with the user's name for a user that has just logged in

Welcome {$ user(thisUser).fullname }!




� HammerKit Oy 2008 UPDATED: 11.07.2008 08:49