colinodell Posted October 22, 2008 Share Posted October 22, 2008 Hey guys, So I'm having trouble with doing a callback in CakePHP (however, since the question is more about PHP than Cake, I'm posting it here). Essentially, I'm having Cake call this helper function (inside of a class) to build some HTML for me. It uses array_map to call any callback I specify (in order to do some extra processing). However, I don't know the object name where my callback function resides (the same place where I call that helper function). I've tried passing array($this,'thecallbackfunction') , array(&this,'thecallbackfunction') , array($this->thecallbackfunction) , etc and nothing is working. Any ideas? Link to comment https://forums.phpfreaks.com/topic/129641-array_map-callback-issues/ Share on other sites More sharing options...
DarkWater Posted October 22, 2008 Share Posted October 22, 2008 Is it in the same class? array(__CLASS__, 'thecallbackfunction'); Link to comment https://forums.phpfreaks.com/topic/129641-array_map-callback-issues/#findComment-672144 Share on other sites More sharing options...
colinodell Posted October 23, 2008 Author Share Posted October 23, 2008 That worked, thanks! Link to comment https://forums.phpfreaks.com/topic/129641-array_map-callback-issues/#findComment-673267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.