it is ok to leave action only, or fill nothing into redirect if you want user to be redirected to current controller and action.
As for your issue arif,
why don't you try some debugging to see if redirect(); is actually called?
if(!empty($this->data))
{
if($this->User->save($this->data))
{
$this->redirect(array('action'=>'index'));
echo "redirect was called";
}
else {
die('no save');
}
}
$this->redirect(array('action'=>'index'));
echo "redirect was called";
}
else {
die('no save');
}
}
Hope this helps,
Faifas
On Sun, Aug 30, 2009 at 10:02, persianshadow <persianshadow@gmail.com> wrote:
hi
what's your controller ?
you must correct this :
$this->redirect(array('controller'=>'product','action'=>'index'));
redirect function need to controller and action but i think you didn't
provide this.
(you must put your own controller name instead product)
On Aug 30, 8:33 am, arif hossen <arifhossen2...@gmail.com> wrote:
> Please help me.
> After Save data no redirect to another page.
> it is cakeconfig any problem?
>
> such as :
>
> function add()
> {
>
> if(!empty($this->data))
> {
>
> if($this->User->save($this->data))
> {
> $this->redirect(array('action'=>'index'));
> }
>
> }
>
> }
>
> but no redirect to index page: page show white screen.What kinds of problem
> is it? Please give solution .
>
> --
> Regards,
> Mohammad Arif Hossen
> Software Enginner
> Epsilon Consulting and Development Services(ECDS)www.ecds-tech.com
> +88 01714355911
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment