Yii extension to create URLs that allow to return to a page by storing its GET Parameters on a stack.
This behavior can create URLs that allow to return to a page by storing its GET Parameters on a stack.
- Extract the release file under
- Attach the beahvior in the [CController::init()] method of any controller you want to use it.
Create an URL that contains all the GET parameter of the current page:
<?php echo CHtml::link('A link', $this->createReturnableUrl('user/edit',array('id'=>124)) );
If you perform an action on the page
user/edit you can use this code to return to the originating page:
or create a link to the originating page in the
<?php echo CHtml::link('Cancel',$this->getReturnUrl()) ?>
See the included demo for a more extensive example.
- Fixed bug with URL creation from module (gerthelsen)
- Fixed bug with multi-dim GET parameters (thanks to Márcio for supplying a fix)
- Name of GET stack variable is now configurable with paramName
- Fixed bug with url compression and path format (thanks to robak for finding this)
- Initial release