Yii Framework Forum: After successful redirect to action, original URL still in address bar - Yii Framework Forum

Jump to content

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

After successful redirect to action, original URL still in address bar Rate Topic: -----

#1 User is offline   Erica 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 16-September 11

Posted 27 October 2011 - 09:48 AM

I have a delete action in my controller that calls a redirect to the index action when the deletion is competed:

public function actionDelete($id) {
		$model = $this->loadReservation($id);
		$model->delete();
		$this->redirect(array('/site/index'));
}


The deletion happens and the index view is displayed correctly in the browser, but the browser address bar still has the URL for the delete action:

localhost:8888/transportation/#/transportation/site/delete/71

If the user then refreshes the page, the screen goes blank. How can I get the new URL to display in the address bar:

localhost:8888/transportation/#/transportation/site/index

Thanks
0

#2 User is offline   Michaël 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 20-November 12

Posted 27 November 2012 - 06:10 AM

Hello,

Does anyone know a solution to solve this issue?

Thanks

Michaël S.

EDIT:
Here is the solution for me:
$this->redirect(Yii::app()->user->returnUrl);
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