Yii Framework Forum: How To Modify Where User Is Redirected After Item Is Deleted - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Modify Where User Is Redirected After Item Is Deleted Rate Topic: -----

#1 User is offline   haosmark 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 27-January 13

Posted 05 March 2013 - 03:56 PM

Every time I delete a record, I'm being redirected to the following url:
index.php?r=crew/admin

how do I change it to be:
index.php?r=crew/index

?
The following is my delete button code:
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType'=>'link',
        'label'=>'Delete',
        'type'=>'danger',
        'size'=>'medium',
        'htmlOptions'=>array(
            'confirm'=>'are you sure?',
            'submit'=>array('delete', 'id'=>$model->crew_code),
            'returnUrl'=>'crew/index'
            )
    ));

returnUrl isn't seem to be doing the trick.
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,595
  • Joined: 04-March 10
  • Location:UK

Posted 06 March 2013 - 05:29 AM

The redirection is handled in your delete action, so you should start there. Post the code here if you can.
0

#3 User is offline   haosmark 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 27-January 13

Posted 06 March 2013 - 09:15 AM

How the hell did I miss that!? :blink:
Thanks for pointing where to look, it's good now.
0

#4 User is offline   ThePaulius 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 17-February 12

Posted 06 March 2013 - 10:21 AM

It's in the Controller actionDelete... i think!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users