It might seem like overkill, but one way of handling this might be: //-------------------------
/app/vendors/something.php class Something extends Object { function doSomethingCool($input) { return $output; } } /app/controllers/components/something.php App::import('Vendor', 'Something'); class SomethingComponent extends Something { // component-specific logic [if any] here } /app/views/helpers/something.php App::import('Vendor', 'Something'); class SomethingHelper extends Something { // helper-specific logic [if any] here } //------------------------- This is how the cakephp session system works (helper and component both extend a shared CakeSession class). It allows the session helper to be read-only, whereas the session component is read-write, but share the same underlying logic. Of course, like I said above, this might well be overkill if you don't really need specific component/helper logic - just put it in a vendor class and go. hth grigri On Apr 17, 10:24 am, dbruensicke <[EMAIL PROTECTED]> wrote: > I have seen a lot of components which use serialized data in sessions > to interchange data between components and helpers. But that would > obviously not work with source-code. I remember a case, where we had a > reference to the corresponding view in a helper and i can imagine that > you could have a reference to the controller, and that way to the > component, too. > > On 16 Apr., 20:05, miuuzn <[EMAIL PROTECTED]> wrote: > > > but i wanna know if i can integrate both so i can really reuse the > > code > > For the example you have said, i could imagine using a vendor-library, > too. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---