Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?= $this->url(array(
- 'controller'=>'my.controller',
- 'action'=>'my.action',
- 'anchor'=>'#myanchor'
- ));
- class My_View_Helper_Url extends Zend_View_Helper_Url
- {
- public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
- {
- if (isset($urlOptions['anchor']) && !empty($urlOptions['anchor']))
- {
- $anchor = $urlOptions['anchor'];
- unset($urlOptions['anchor']);
- }
- else
- {
- $anchor = '';
- }
- return parent::url($urlOptions, $name, $reset, $encode).$anchor;
- }
- }
- <?= $this->url(array(
- 'controller'=>'my.controller',
- 'action'=>'my.action',
- 'anchor'=>'#myanchor'
- ));
- class My_View_Helper_Url extends Zend_View_Helper_Url
- {
- public function url(array $urlOptions = array(), $name = null,
- $reset = false, $encode = true,
- $fragment_id = null)
- {
- $uri = parent::url($urlOptions, $name, $reset, $encode);
- if(!is_null($fragment_id)) {
- $uri .= "#$fragment_id";
- }
- return $uri;
- }
- }
Add Comment
Please, Sign In to add comment