• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Functions in UDTs
PostPosted: Wed Mar 27, 2013 10:15 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 22, 2005 11:19 am
Posts: 287
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:
Code:
if (!function_exists ('myfunction') {
  function myfunction (){
  ...
  }
}


That way when it's called again, eg in a {foreach} loop, all will go well.

hth
psy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting