The curly bracket {} syntax takes a tagged expression and converts it into a PHP string expression. It is a way of accessing data which is in recordsets and components. It allows you to build expressions which can be evaluated by Arcos and to obtain field values from recordsets, state and session values.
For example, the XML code:
test{POST.value}fish
evaluates to the following PHP string:
'test'.$gManager->GetPostValue('value').'fish'
Which would then be displayed in a document as:
echo '<'.'?='.Componets-GetValueExpression('test{POST.value}fish').'?'.'>';
XML | {1 - {POST.value}} |
PHP | '1 - '.$gManager->GetPostValue('value') |
XML | {?1 - {POST.value}} |
PHP | 1 - $gManager->GetPostValue('value') |
XML | {Recordset.Field=""} |
PHP | $Recordset[0]->GetFieldValue('value') |
XML | {Recordset.Field.Validation=""} |
PHP | $Validation[145-44] |
XML | {Security.GetPassword({Recordset.password})} |
PHP | {Security.GetPassword="{Recordset.password}"} |
XML | {Security.GetPassword({Recordset.password},'random string')} |
PHP | ?? |
XML | {Recordset.Field.Validation="You must enter {POST.Value}"} |
PHP | 'You must enter '.$gManager->GetPostValue('value') |
XML | {POST.value;POST.valux} |
PHP | ($gManager->IsPostValueSet('value')?$gManager->GetPostValue('value'):$gManager->GetPostValue('valux')) |
VAL = [[String]|[TAG]]... TAG = {[?][VAL]]} | {[?]Name[.Name]...[="VAL"]} | {[?]Name[.Name]...[([TAG|"VAL"][,[TAG|"VAL"]]...)]} | {Name[.Name]...[[@;]Name[.Name]...]...}
String: Any string, \ should be used as an escape character
?: php literal string - do not treat as string
x;y use x if it is set else use y
x@y use x if it is set and not ==='' else use y
There are several special words in the tagged expression syntax:
const.[type].name | = CONST_[type]_name (where type defaults to LOCAL) |
url.name | = get a value from the url (get;post;state) mirror current behaviour |
post.name | = get a value from the post only (currently === to url) |
get.name | = get a value from the get only (currently === to url) |
state.name.name | = get a value from the state only (currently === to url) |
cookie.name | = get a value from a cookie |
eval(valueexpr) | = evaluate the first parameter and pass it back. Useful within KVALUE tags |
To match up with the const type there is a file config/constants.inc
which should be used to store local constants, that is: define(CONST_LOCAL_VALUE, '0')