I'm having in my front .html or .tpl page following:
<select name="" id="selectBox" class="fancyDrop" onchange="showFunc()">
<option selected></option>
<option value="20"><?php echo $this->translate('по 20');?></option>
<option value="50"><?php echo $this->translate('по 50');?></option>
<option value="100"><?php echo $this->translate('по 100');?></option>
<option value="<?php echo $this->totalValue;?>"><?php echo $this->translate('Text');?></option>
</select>
..........................................................................
<script type="text/javascript">
function showFunc() {
var selectBox = document.getElementById("selectBox");
var selectedValue = selectBox.options[selectBox.selectedIndex].value;
window.location.href = "<?php echo $this->url(); ?>?perPage=" + selectedValue;
}
</script>
I'm trying to redirect to current controller and action and also set value perPage and in controller i'm getting it with
$perPage = $this->_getParam('perPage', 25);
. Above method work but is simple and it shows in user's browser http://website.net/index?perPage=25 for example. Problem is that user can change this value and behaviour of page will also be change.
I've tried to use $this->_forward('route');
but that gives me and redirect loop, also _redirect($url, array $options = array())
i think also creates an redirect loop.
Problem To redirect from front-end .html/.tpl file to certain action/controller/module, currently the same action/module/controller when 1 option is selected and set parameter perPage
so that user wouldn't see this value.