Helpers and Components

2006-10-20 Thread davide
Sometime ago, I developed my own helpers for formatting date. Everything is ok, but now I need those function even in the controller level. So I thought about components. Everything is still fine. Now I wouldn't like to duplicate the code, I would like something like using the components code from

RE: Helpers and Components

2006-10-20 Thread Christian Winther
You could make your methods static and access them with ClassName::yourMethod aswell as $className-yourMethod /Christian -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of davide Sent: 20. oktober 2006 11:49 To: Cake PHP ML Subject: Helpers

Re: Helpers and Components

2006-10-20 Thread leo.cacheux
You forgot to call view in the helper : class MyHelper... function dumb(param1, param2){ return $this-view-controller-MyComponent-dumb(param1, param2); } ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Helpers and Components

2006-10-20 Thread davide
leo.cacheux wrote: You forgot to call view in the helper : class MyHelper... function dumb(param1, param2){ return $this-view-controller-MyComponent-dumb(param1, param2); } Cool, it works! Now the question is: is this the better way to implement the feature? Otherwise, what

Re: How to use Helpers in Components (?)

2006-07-23 Thread 379 the manifesto
Ok thanks, I did that, now my Component gets my menu links array, and in the View my presentation Helper loops through the array and builds up a string of menu links which I then print out at the end of the Helper Method. Which makes a lot more sense, glad I got that sorted out early on... I