0

I am having a link to go to update screen and in the update screen a back button to load the index.

*current url is * http://sample.com/demoZend/public/index/ when i click a post, i take it to this URL, http://sample.com/demoZend/public/index/update/id/1

now there is a button in this view to go back to index.

<?php
$this->title = "Update post";
$this->headTitle('Update Post');

echo $this->form;
?>
<a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'index')); ?>">Go Back</a>

the problem is, when back button is clicked it goes here, http://sample.com/demoZend/public/index/index/id/1 instead of http://sample.com/demoZend/public/index/index/

This param id is still remaining. id/1 how this param can be removed and make the url to be public/index/index/

I am newbie to zend framework. so this must be a tiny thing for someone who work with zend.

dev1234
  • 5,376
  • 15
  • 56
  • 115

1 Answers1

1

Use the Reset Parameter on the Url Helper, to reset all params

function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)

echo $this->url(array('controller'=>'index', 'action'=>'index'), null, true);

ins0
  • 3,918
  • 1
  • 20
  • 28
  • please take a look out this http://stackoverflow.com/questions/20475079/update-a-record-through-model-in-zend-framework – dev1234 Dec 09 '13 at 16:36