Question 


Calling Another Interaction Via A Fetch


Answer 


Calling Another Interaction Via A Fetch

$t->fetch('http://blinkm.co/_R_/common/3/xhr/GetAnswer.php?');

Description #

There are times when you need to call an answerspace internally. This can be done via a Fetch command in mADL An internal call to GetAnswer.php along with the parameters will return the called interactions values.

Parameters # 

asn= the answerspace
iact= the interaction 

Return values#

Returns requested source into $t->result 

Examples # 

$t->fetch('http://blinkm.co/_R_/common/3/xhr/GetAnswer.php?asn=blinkhelp&iact=datestamp-raw&args[0]=123456789');
return $t->result;

This example calls the interaction "datestamp" in the answerspace "blinkhelp". In this case we are sending "123456789" to be converted to a date. The called interaction code is

// datestamp code
$t->result = date( "d/m/Y h:i:s A", $args[0]);
return $args[0] . "   <=>  " . $t->result;

The returned value is 123456789 <=> 30/11/1973 08:33:09 AM