Nice, thank you! On Thu, Sep 16, 2010 at 5:33 PM, cricket <[email protected]> wrote: > On Thu, Sep 16, 2010 at 7:05 AM, Joshua Muheim <[email protected]> wrote: >> OK, I've come up with the following: >> >> function setFlashAndRedirect($message, $url) { >> $this->Session->setFlash($message); >> $this->redirect($url); >> } >> > > This is what I put in AppController: > > public function flash($msg, $redirect = null, $layout = null) > { > $this->Session->setFlash($msg, (is_null($layout) ? 'flash_msg' : > $layout)); > if (!is_null($redirect)) > { > $this->redirect($redirect); > exit(0); > } > } > > In views/layouts/ I have several flash layouts. > > flash_msg: > <div id="flash_msg"> > <?= $content_for_layout ?> > <p><a class="HideFlash" href="<?= $_SERVER['REQUEST_URI'] ?>" > title="close">dismiss</a></p> > </div> > > flash_error: > <div id="flash_msg" class="error-message"> > <?= $content_for_layout ?> > <p><a class="HideFlash" href="<?= $_SERVER['REQUEST_URI'] ?>" > title="close">dismiss</a></p> > </div> > > flash_ajax: > <div id="flash_msg"> > <?= $content_for_layout ?> > </div> > > etc. I also have a JQuery function to handle placement, removing when > the link is clicked, fadeout, etc. > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" 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?hl=en >
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" 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?hl=en
