https://devhubby.com/thread/how-to-call-a-recursive-function-in-smarty