It's not clear what you mean by getting the data to the element. Do you mean that you want to render the element, or that the element contains a call to requestAction()? If so, just return the data instead of calling set().
On Mon, Apr 16, 2012 at 12:38 AM, hoss7 <[email protected]> wrote: > thank you cricket > > but i cant undrestand where i must put this code,this is my code: > > i have one function in newscontroller like this: > > function randomnews(){ > > $rnews=$this->News-find('first',array('order'=>'Rand()'); > $this->set('news',$rnews); > } > > i want send this result to some element : Elements/sidebar2.ctp > > to show some random news in this element,i dont need user request this > action,i need show automatic result when page loading > > i hope you can show me how can i edit this code to show result in elements > > thanks > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
