I create a function and use it illustrated as the image below
but when trace the source code I found it was blocked on that line and the application run into a wierd function in the smarty ( I use the smarty in my project)
I got the reason after investigation for a while, it is because of missing the inclusion of the class file