Re: Use Controller in Helper
On Mar 10, 9:09 pm, wolf net wrote: > Controller: $this->set('controller', $this); > view: $controller->action(); IMHO that's a bad idea on many levels. What I meant was something like: $this->set('testResults', $this- >CustomComponent->getTest()); Then in the view you use $testResults. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Use Controller in Helper
Controller: $this->set('controller', $this); view: $controller->action(); 2009/3/11 mscdex > > On Mar 10, 12:29 pm, bäckerlehrling wrote: > > Now how can i acces the CustomController in the CustomHelper to call > > the CustomController's CustomComponent Method getTest()? How would you > > do this? > > I would do a call to $this->set() in your controller to set a variable > to be used in the view which contains the results of getTest(). > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Use Controller in Helper
On Mar 10, 12:29 pm, bäckerlehrling wrote: > Now how can i acces the CustomController in the CustomHelper to call > the CustomController's CustomComponent Method getTest()? How would you > do this? I would do a call to $this->set() in your controller to set a variable to be used in the view which contains the results of getTest(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Use Controller in Helper
Thats completely against the concept, why on earth are you doing it that way? Helpers are used for view support, Components are used for controller support. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---