Brilliant! Why didn't I think of that?! Worked fine - thanks very much! Sharon
On 8 Dec, 16:57, Jeremy Burns <[email protected]> wrote: > Try: > > $this->accept($id); > > On Dec 8, 4:54 pm, WhyNotSmile <[email protected]> wrote: > > > This may be really dumb, but I'm having trouble calling a function > > from within a controller. Here's my set up: > > > function accept_this($id = null) { > > ... some bits of code ... > > $result = accept($id); > > ... processing of result ... > > > } > > > function accept($id = null) { > > ... some code ... > > return $result; ($result has been set in the code part of this > > function) > > > } > > > When I try to run this, I get: > > > Call to undefined function accept() in users_controller.php on line > > 356 > > > I don't know a whole lot about PHP functions - what am I doing wrong? > > I've checked obvious things like spelling. I'd really like to be able > > to do this, because it allows me to reuse the bit of code in 'accept > > ()'. > > > Thanks! > > Sharon Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
