Firstly I would like to make my apologies for not being clear enough in my initial explanation.
I am trying to build a document library where multiple users can login to upload or view document files(pdf,txt,doc) and other users can post comments on documents uploaded. I have a controller named posts with 2 action (previewpost, addpost) so far. The addpost action should send the $this->data to another action named previewpost and then redirect the current view to the (previewpost.ctp) view. The content of $this->data was gathered from a html form post in the (addpost.ctp) view. Inside the (previewpost.ctp) view it will show the content of the new post submit by (addpost.ctp) view and then the action for the (previewpost.ctp) view will determine if the user wishes save or discard the info submitted by the (addpost.ctp) view. I would like to know if an action can send info to other actions inside other controllers. For instance controller A action is insideA and controller B action is insideB then can the two controllers send info to each thru their actions? I hope this is any clearer unfortunately I am unable to provide you with any code snippet because I am stump and I am not sure as to how to proceed any further. thanks for your help everyone. On Feb 9, 2:30 pm, Sam Sherlock <[email protected]> wrote: > This is the second time you have asked this question. > > Like the first time the question is lacking information, required to give > you an informative answer > > you are better off describing what you are trying to do > and providing info on what you have tried (with code samples) > > this way others can understand your goal and will be in a better position to > provide > an answer > -- > > With a Controller Posts (an action has a corresponding view a ctp file in > views/<CONTROLLERNAME>/) > > it may have multiple actions eg > index - all posts > view - a single post viewed by id > > so pass the id from index to view, so that > the view displays a post item. > > in the view for the action `views/posts/index.ctp` > you use the echo $html->link('read more >>', array('action' => 'view', > $post['Post']['id'])); > assuming you are within a foreach loop > > --- > > although you might be asking how to access a property in one method > when you have assigned it from another method. > > actions of controllers are methods not all methods are actions > > you should read up on object orientated programming > and the concept of MVC. > > - S > > On 9 February 2011 18:56, zer0_gravity <[email protected]> wrote: > > > > > How can I in cake forward data from one action to another action > > within the same > > controller? > > > -- > > Our newest site for the community: CakePHP Video Tutorials > >http://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://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
