SO I have a getResources call giving me an integer value with this call:
[[!getResources? &parents=`[[*id]]` &totalVar=`totalLinks`]]
That outputs to [[+totalLinks]] and I use that to input in to my snippet
[[!ChangeNumberToWord? &input=`[[+totalLinks]]`]]
My Snippet:
$input = '';
function converttoword($total){
if ($total=="1"){
$word = "one";
} elseif($total=="2") {
$word = "two";
} elseif($total=="3") {
$word = "three";
} elseif($total=="4") {
$word = "four";
} elseif($total=="5") {
$word = "five";
} elseif($total=="6") {
$word= "six";
} elseif($total=="7") {
$word ="seven";
} elseif($total=="8") {
$word = "eight";
} else{
$word = "$total";
}
return $word;
}
$output = converttoword($input);
return $output;
My question is how I glue these 2 together so I only need to call my snippet?