I need to pass a parameter to a new page (without query strings), because I would like to redirect back to the module and query string of the current page.
So I can get from
- showdown/index?id=35 –click—> showdown/vote?id=1
- showdown/vote?id=1 –redirect–> showdown/index?id=35
The vote action is not seen.
(The redirect method doesn’t work as it redirects to the plain index.php homepage url only and not keeping the module/action intact, and I cannot find a helper in Magento for creating hyperlinks.)
Does Magneto have a link helper for this?
Example of stuff I want: <a href="<?php echo Mage::Helper->Link->($url, $array); ?> then $array or whatever variables gets sent to the controller (page I linked to).
Can I use a POST style hyperlink? (I can in Symfony/Yii/Rails/Ramaze frameworks. Why not Zend?)
Link clicks will not result in a POST request without JavaScript.
Magento Url helper has the syntax
which would result in a lookup of the frontName for
moduleand would give you for examplewhich you could then access with
Mage::app()->getRequest()->getParam('id').If you have multiple URLs involved (like a form post), you can also redirect the user within the controller by using
You can also create a query string with