> Hmm. But is there a possibility to use one instance of Component in few
> Controllers? That solution would be nice.
You can turn Your component to singleton and then use static call
(example) MyComponent::getInstance().
OR - as mentioned in my previous post - Your component can use
ClassRegistry as storage for common data - array, object, whatever.
Example:
$myData = array();
$myData['user'] = array('id'=>1, 'name'=>'John Doe');
ClassRegistry::addObject('myData', $myData);
...
// and then somewhere else
$myData = ClassRegistry::getObject('myData');
Consider also methods ClassRegistry::isKeySet() and
ClassRegistry::removeObject()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---