LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: tedd Date: Fri May 9 11:06:18 2008 Subject: Re: Recursion... Sort of...
At 5:48 PM -0400 5/8/08, Matt Neimeyer wrote: >Is there a way to tell if a function has been called that has resulted >in a call to the same function? > >We have an in-house CRM app that has a function that draws a tabbed >panel on a screen... BUT if there are sub-sub-tabbed panels we want to >invert the tab colors and panel colors... > >So... > >DrawSubTab($Set) - Black on White > Content > DrawSubTab($Set) - White on Black > Content > DrawSubTab($Set) - Black on White > Content > DrawSubTab($Set) - Black on White > Content > Etc... > >I suppose I could rewrite EVERY call to the function with a recursion >count like DrawSubTab($Set,$DepthCount+1) but that would be a MASSIVE >commit... whereas if the function can determine itself... All that >said I can't think of a good way to do it without a bastardized global >variable that track "how deep" we are and there is something that >bothers me about that approach... Unless that really is the easiest >way. > >Thanks in advance! > >Matt If the CRM app uses a browser, then it sounds like a problem that could be solved via css -- parent/child relationships. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com
| Navigate in group php.general at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |