xreturnable
This behavior can create URLs that allow to return to a page by storing its GET Parameters on a stack.
Resources
The extension evolved from this forum discussion. Please add any comments or bug reports there.
Copyright © 2009 by Michael Härtl All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of xreturnable nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Available Downloads
| File | Summary | Uploaded on | Downloaded |
|---|---|---|---|
| xreturnable-1.0.2.zip (7.3 KB) | 1.0.2 | November 11, 2009 | 75 |
| xreturnable-1.0.1.zip (6.8 KB) | 1.0.1 | July 13, 2009 | 82 |
| xreturnable-1.0.0.zip (6.8 KB) | 1.0.0 | June 8, 2009 | 81 |
Release 1.0.2, November 11, 2009
- 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
Release 1.0.1, July 13, 2009
- Fixed bug with url compression and path format (thanks to robak for finding this)
Release 1.0.0, June 8, 2009
- Initial release
Installation
- Extract the release file under
protected/extensions - Attach the beahvior in the CController::init() method of any controller you want to use it.
Usage
Create an URL that contains all the GET parameter of the current page:
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:
$this->goBack()
or create a link to the originating page in the view with:
echo CHtml::link('Cancel',$this->getReturnUrl())
See the included demo for a more extensive example.
