CakePHP dynamic element

Posted by Logic Artist on Stack Overflow See other posts from Stack Overflow or by Logic Artist
Published on 2010-06-15T01:22:13Z Indexed on 2010/06/15 1:22 UTC
Read the original article Hit count: 349

Filed under:
|

I am trying to create a message-board type element in a CakePHP app. This element will be displayed on all pages and views that use a particular layout. I want it to display all the messages in the model, then show the add form when a link is clicked, then return to the updated message list when submitted. All this without affecting the current view/page.

I have my message model/controller/index set up, with a message board element that requests the index action. This works fine. However I am perplexed about how to return back to the original page/action from which the link was clicked. I can't use $this->referer() because that will link back to the add() action; what I want rather is to link to the page/view before that.

Any general pointers on how to achieve something like this?

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about element