HtmlHelper link with anchor target


I would like to build a link with an anchor target to jump to a specific place on an other page.

Ive tried using the # as stated in the documents:

['controller' => 'documents', 'action' => 'index', '#' => $document['slug']]

but it doesnt work :frowning:

# Invalid path provided; must not contain a URI fragment

Whats wrong here?

I am using latest CakePHP 3.6


i dont see this error in cake source

are you sure its from cake?

Thanks for your hint: Interesting - its from Zend:


Its installed through cake…so what now?


ive checked it on 3.6.13 and it works for me,

<?= $this->Html->link('test', [
  'controller' => 'Home', 
  'action' => 'index', 
  '#' => 'test'
]) ?>

you need to give more code at this point