You are not logged in.
Pages: 1
Is there a reason that the following recursive function generates an error when being implemented in my BigTreeCustom class? Other functions in this class work fine and it seems like this function works until the recursive call. I also tried writing another recursive function and received the same error. Is there something BigTree does to prevent this?
function recursive($number) {
echo $number;
$number = $number - 1;
if($number > 0):
recursive($number);
else:
echo "Finished";
endif;
}
The error returned is Fatal error: Call to undefined function recursive() in \custom\admin\class_extensions\BigTree.php on line 118 (which references the recursive call inside the if statement).
Thanks
Offline
Since "recursive" is defined in a class you need to call it with $this->recursive as it's a method of the class and not a global function.
Offline
That makes sense.
Thanks for your help.
Offline
Pages: 1