Yii Framework Forum: problem on return url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

problem on return url Rate Topic: -----

#1 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 19 June 2009 - 07:58 AM

Hi
In home page i have a link for form3
and in another page(form2) i have a link for form3
i give a cancel button with following code

<?php echo CHtml::submitButton('Cancel',
    array('name'=>'cancel',
'submit'=>array('holiday/home'),
'params'=>array('url'=>Yii::app()->user->returnUrl) ,
'confirm'=>'Are sure without Save/Modify/Delete Type?')); ?>

when i got form3 from form2 on clicking cancel on form3 it gives homepage, how to change it when i come from homepage it have to give homepage and when i come from form2 it should display form2
how
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 19 June 2009 - 08:39 AM

I've created an extension for this kind of problem. Check it out here:
http://www.yiiframew...on/xreturnable/

See the examples contained in the extension to understand what you can do with it.
0

#3 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 20 June 2009 - 01:21 AM

problem solved by passing value in form2 linkbutton and checked it by $_GET in form3

in homepage link button 

CHtml::linkButton('Add/Modify Type', array(
    'submit'=>array('holiday/addmodifydeletetype'),
    'params'=>array('url'=>Yii::app()->request->url),
));
in form2

CHtml::linkButton('Add/Modify Type', array(
    'submit'=>array('holiday/addmodifydeletetype','test'=>'test'),
    'params'=>array('url'=>Yii::app()->request->url),
    ));

in form3

<?php if(isset($_GET['test'])) {
echo CHtml::submitButton('Cancel',
    array('name'=>'cancel',
'submit'=>array('holiday/addModifyDelete'),
'params'=>array('url'=>Yii::app()->user->returnUrl) ,
'confirm'=>'Are sure without Save/Modify/Delete Type?'));
}
else
{
echo CHtml::submitButton('Cancel',
    array('name'=>'cancel',
'submit'=>array('holiday/login'),
'params'=>array('url'=>Yii::app()->user->returnUrl) ,
'confirm'=>'Are sure without Save/Modify/Delete Type?'));
}
?>
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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