Functions in UDTs
Posted: Wed Mar 27, 2013 10:15 am
I knew this before but forgot and wasted a lot of time wondering why my UDT kept crashing on the 2nd iteration.
Functions declared in UDT's are remembered. Wrap them in the PHP function:
That way when it's called again, eg in a {foreach} loop, all will go well.
hth
psy
Functions declared in UDT's are remembered. Wrap them in the PHP function:
Code: Select all
if (!function_exists ('myfunction') {
function myfunction (){
...
}
}
hth
psy