Class RequestContext

Description
Variable Summary
Method Summary
RequestContext RequestContext ()
void assignRequestHandler (ref $handler)
string endNamespace ()
void forget (string $key)
mixed get (string $key)
array getKeys ()
string getName (string $name)
string getRequestedAction ()
string getRequestedModule ()
void locationHeader (string $url)
ref mkURL ([optional $module = null], [optional $action = null], [optional $variables = null])
ref mkURLWithPassthrough ([optional $module = null], [optional $action = null])
string name (string $key)
void ob_jump ()
void ob_land ()
void passthrough (optional 0)
string quickURL ()
void sendTo (string $url)
void set (string $key, string $value)
void startNamespace (string $name)
void update ()
string value (string $key)
void _checkName (mixed $name)
string _mkFullName (mixed $key)
Variables
array $_contextData (line 138)
  • access: private
string $_currentNamespace (line 133)
  • access: private
array $_fileData (line 148)
  • access: private
array $_namespaces (line 128)
  • access: private
array $_requestData (line 143)
  • access: private
object RequestHandler $_requestHandler (line 153)
  • access: private
Methods
Constructor RequestContext (line 164)

Constructor.

  • access: public
RequestContext RequestContext ()
assignRequestHandler (line 178)

Assigns a RequestHandler to this RequestContext object. The RequestHandler provides the bridge between the browser and the data driving requests.

  • access: public
void assignRequestHandler (ref $handler)
  • ref $handler: object RequestHandler $handler
endNamespace (line 368)

Ends a namespace started previously. The last-started namespace is ended.

  • return: The name of the namespace just ended.
  • access: public
string endNamespace ()
forget (line 407)

Ensures that $key is removed from the context-data (and not included in URLs generated later). If you pass a name like "context1/context2/name", the RequestContext uses it as a context-insensitive name (ie, you are specifying the absolute namespace).

  • access: public
void forget (string $key)
  • string $key: the key to forget.
get (line 446)

Returns the string-value of the $key passsed. It will first check for request

data under that name, then context data. The key passed will be located within the current namespace. If you pass a name like "context1/context2/name", the RequestContext uses it as a context-insensitive name (ie, you are specifying the absolute namespace).

  • return: Either a string, in the case of a regular key, or an array in the case of a file.
  • access: public
mixed get (string $key)
  • string $key
getKeys (line 461)

Returns a list of keys within the current context.

  • access: public
array getKeys ()
getName (line 345)

Returns the full contextual name of a field or variable. If passed "test", it may return something like "context1.context2.test". This function is useful when creating HTML forms.

  • access: public
string getName (string $name)
  • string $name
getRequestedAction (line 235)

Answer the currently requested action

  • since: 5/23/07
  • access: public
string getRequestedAction ()
getRequestedModule (line 223)

Answer the currently requested module

  • since: 5/23/07
  • access: public
string getRequestedModule ()
getRequestedModuleAction (line 211)

Returns a string ("module.action" format) of the requested module and action.

  • access: public
string getRequestedModuleAction ()
locationHeader (line 75)

Send a properly formatted location header. XHTML specifies that the ampersand character, '&' be replaced with '&'. Location headers however fail to redirect with '&'. This method properly formats location headers.

  • since: 7/19/05
  • static:
  • access: public
void locationHeader (string $url)
  • string $url
mkURL (line 249)

Returns a new URLWriter from the RequestHandler, assigning the module/action passed or keeping the current module/action.

  • return: object URLWriter
  • access: public
ref mkURL ([optional $module = null], [optional $action = null], [optional $variables = null])
  • optional $module: string $module
  • optional $action: string $action
  • optional $variables: array $variables
mkURLWithPassthrough (line 290)

Returns a new URLWriter from the RequestHandler, assigning the module/action passed or keeping the current module/action. As well, mkFullURL passes through all Request and Context data through to the resulting Url.

  • return: object URLWriter
  • since: 6/7/05
ref mkURLWithPassthrough ([optional $module = null], [optional $action = null])
  • optional $module: string $module
  • optional $action: string $action
name (line 39)

A quick shortcut function to get the expanded contextual name for a form field or request variable. Calls RequestContext::getName() with the passed $key.

Returns the full contextual name of a field or variable. If passed "test", it may return something like "context1.context2.test". This function is useful when creating HTML forms.

  • access: public
  • static:
string name (string $key)
  • string $key
ob_jump (line 524)

Climbs down the ob ladder and saves the data to put back later

  • since: 6/14/06
  • access: public
void ob_jump ()
ob_land (line 542)

Climps back up the ob ladder adding back the data that was there

  • since: 6/14/06
  • access: public
void ob_land ()
passthrough (line 424)

Copies the value(s) of keys passed from the request-data to the context

data. This is useful when request variables will be re-used later as contextual variables. If you pass a name like "context1/context2/name", the RequestContext uses it as a context-insensitive name (ie, you are specifying the absolute namespace). If no parameters are passed, all variables in the current namespaced are passed through.

  • access: public
void passthrough (optional 0)
  • optional 0: string $key1,...
quickURL (line 310)

Quickly generates a URL string from the optional passed module/action and the optional array of values to replace in the URL request data. The function can take any of the following forms:

quickURL(string $module, string $action) quickURL(string $module, string $action, array $variables) quickURL(array $variables) quickURL()

if the module/action are omitted, the last requested module/action is used.

  • access: public
string quickURL ()
sendTo (line 91)

Send the browser to the url specified. Location headers will be sent if possible, otherwise a javascript redirect will be printed outside of all output buffers

  • since: 6/14/06
  • static:
  • access: public
void sendTo (string $url)
  • string $url
set (line 392)

Sets $key to $value in the context-data (this data is included automatically when building new URLs). If you pass a name like "context1/context2/name", the RequestContext uses it as a context-insensitive name (ie, you are specifying the absolute namespace).

  • access: public
void set (string $key, string $value)
  • string $key
  • string $value
startNamespace (line 357)

Starts a new namespace below the current namespace. This allows for the separation of context/request variables. Namespaces can be embedded, so it is important to call RequestContext::endNamespace().

  • access: public
void startNamespace (string $name)
  • string $name: The name of the new namespace.
update (line 188)

Tells the RequestHandler to retrieve any request variables from the browser and updates the internal context and request data to match.

  • access: public
void update ()
value (line 59)

A quick shortcut function to get the value of the variable in the current context.

Calls RequestContext::get() with the passed $key.

Returns the string-value of the $key passsed. It will first check for request data under that name, then context data. The key passed will be located within the current namespace. If you pass a name like "context1/context2/name", the RequestContext uses it as a context-insensitive name (ie, you are specifying the absolute namespace).

  • access: public
  • static:
string value (string $key)
  • string $key
_checkForHandler (line 486)
  • access: private
void _checkForHandler ()
_checkName (line 511)
  • access: private
void _checkName (mixed $name)
_mkFullName (line 496)
  • access: private
string _mkFullName (mixed $key)

Documentation generated on Wed, 19 Sep 2007 10:26:04 -0400 by phpDocumentor 1.3.0RC3