I don't think you are trying to write a component. Put your file in /app/vendors/my_class.php, load it via vendor('my_class'); and work with it as you normally would with any class.
-- Felix -------------------------- http://www.thinkingphp.org http://www.fg-webdesign.de Humble Groups wrote: > Hi, > > I am trying to implement custom RecursiveIterator, so I wrote a > component in app/controllers/components/Recursive_Thread_Iterator.php as > > <?php > > class RecursiveThreadIteratorComponent extends ArrayIterator > implements RecursiveIterator { > > function hasChildren() { > $message = $this->current(); > return isset($message['children'][0]); > } > > function getChildren() { > $message = $this->current(); > return $message['children'][0]; > } > } > ?> > > Now, I am not able instantiate it since it expects constructor > parameter. If I try > var $components = array('RecursiveThreadIterator'); > > it throws error on initializing the ArrayIterator. If I use the > following syntax after removing the $components, it throws *Fatal > error*: Class 'RecursiveThreadIteratorComponent' not found in * > <folder>\view-messages\app\controllers\messages_controller.php* on > line *37 > > *$foo =& new RecursiveThreadIteratorComponent($thread_messages); > > When I checked the components.php, it does not initialize by calling > the constructor and handle initializing SessionComponent seperately. > > Is there anyway I instantiate by passing parameter? > > TIA > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---