Removing parameters from a URL when using URL links

When using the URL browser to create links, if the current page has parameters in the URL, the url generated by the URL browser will also contain parameters.

For example, the following code is shown on the / controller / action / param / value / page:

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

will output:

 <a href="/index/index/param/value/">Dashboard</a> 

Can I clear the URL provided by the parameter helper?

+7
zend-framework view-helpers
source share
1 answer

I think the third parameter for the helper will clear the default parameters, for example.

 <a href="<?php echo $this->url(array( 'controller' => 'index', 'action' => 'index' ), null, true) ?>">Dashboard</a> 

Documentation: http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial

+21
source share

All Articles