You can follow below code:

$this->Sesssion->setFlash(__('Bill was sent by e-mail successfully',
true));
$this->redirect(array('controller' =>
'controllername','action'=>'actionname'));


On Thu, Aug 6, 2009 at 6:32 AM, Eddy Josafat <[email protected]> wrote:

>
> Thanks for advice. It was a typo: notificación instead of
> notificacion. Sorry for wasting your time!
>
> On Jul 30, 5:12 pm, "Dr. Loboto" <[email protected]> wrote:
> > Error before redirect causes "blank page". Turn debug on and look at
> > this error.
> >
> > On Jul 29, 10:29 pm, Eddy Josafat <[email protected]> wrote:
> >
> >
> >
> > > I have same problem and I don't use any translation.
> >
> > > $this->Session->setFlash('Contraseña modificada', 'notificación');
> > > $this->redirect(array('controller' => 'gestion', 'action' =>
> > > 'display', 'inicio'));
> >
> > > I get a blank page and no redirect with previous code. If I comment
> > > the line that sets the flash message it works fine.
> >
> > > In another place of my app, if I create a new record, flash + redirect
> > > works perfectly:
> >
> > > function nueva() {
> > >                 if (!empty($this->data)) {
> > >                         // Guardar fichero y almacenar url si se ha
> subido una imagen
> > >                         $url =
> $this->_url_uploaded_file($this->data['Document']
> > > ['submittedfile']);
> > >                         if ($url) {
> > >
> $this->data['Noticia']['url_imagen'] = $url;
> > >                         } // $url
> > >                         if ($this->Noticia->save($this->data)) {
> > >                                 $this->Session->setFlash('Noticia
> guardada con éxito',
> > > 'notificacion');
> > >                                 $this->redirect(array('action' =>
> 'listado'));
> > >                         } else {
> > >                                 $this->Session->setFlash('No ha podido
> almacenarse la noticia',
> > > 'error');
> > >                         } //   $this->Documento->save($this->data)
> > >                 } // !empty($this->data)
> > >         }
> >
> > > but when I'm doing editing an existing record:
> >
> > > function editar($id = null) {
> > >                 $this->Noticia->id = $id;
> > >                 if (empty($this->data)) {
> > >                         $this->data = $this->Noticia->read();
> > >                 } else {
> > >                         $url =
> $this->_url_uploaded_file($this->data['Document']
> > > ['submittedfile']);
> > >                         if ($url) {
> > >                                 // Borrar el anterior
> > >                                         $noticia =
> $this->Noticia->read();
> > >                                         if (
> $noticia['Noticia']['url_imagen'] != $url ) {
> > >
> @unlink($noticia['Noticia']['url_imagen']);
> > >                                         }
> > >
> $this->data['Noticia']['url_imagen'] = $url;
> > >                         }
> > >                         if ($this->Noticia->save($this->data)) {
> > >                                 $this->Session->setFlash('Noticia
> modificada', 'notificación');
> > >                                 $this->redirect(array('action' =>
> 'listado'));
> > >                         } else {
> > >                                 $this->Session->setFlash('No ha podido
> almacenarse la noticia',
> > > 'error');
> > >                         }
> > >                 }
> > >         }
> >
> > > flash + redirect causes a blank page.
> >
> > > What's the matter aobut flash messages and redirects?
> >
>


-- 


Regards,
Mohammad Arif Hossen
Web Developer
United Group International(UGIBD)
www.ugibd.net
Mobile no:  +88 01714355911
Mobile no:  +88 01922110308

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to