RequestService::SetRequestKey (since version 2.0)
Syntax
boolean SetRequestKey ( string $container , mixed $values )
Parameters
container
The request container to overwritte.
values
The value or values to assign to the given container.
Description
Sets the given request container values.
Note:
If the container already exists, it will be overwritten.
Note:
If the container already exists, it will be overwritten.
Return
boolean Returns true on sucess, or false on fail.
See also
Examples
<?php
// URL http://domain.com/page/index/target/user/id/10
// retrieve the id parameter
$id = RequestService::GetRequestParamKey('id');
// set request parameter key
RequestService::SetRequestKey('params', array('target' => 'user));
// retrieve the id parameter
$new_id = RequestService::GetRequestParamKey('id);
var_dump($id);
var_dump($new_id);
?>
Output:
(int) 10
(bool) false
// URL http://domain.com/page/index/target/user/id/10
// retrieve the id parameter
$id = RequestService::GetRequestParamKey('id');
// set request parameter key
RequestService::SetRequestKey('params', array('target' => 'user));
// retrieve the id parameter
$new_id = RequestService::GetRequestParamKey('id);
var_dump($id);
var_dump($new_id);
?>
Output:
(int) 10
(bool) false
Last change 10/18/2009