Logo

Html->link()

ops...

Description

General purpose method for creating HTML links. Use $options to specify attributes for the element and whether or not the $title should be escaped.

Usage: link($title, $url = null, array $options = []) echo $this->Html->link( 'Enter', '/pages/home', ['class' => 'button', 'target' => '_blank'] ); echo $this->Html->link( '<button class="fs-3 mt-3 d-inline js-search-button">Search</button>', ['controller' => 'Cats', 'action' => 'index'], ['escape' => false, 'class' => 'text-decoration-none js-link-search','href' => '/cats/index//0'] ,) Output: <a href="/pages/home" class="button" target="_blank">Enter</a> <a href="/" class="text-decoration-none js-link-search"> <button class="fs-3 mt-3 d-inline js-search-button">Search</button> </a>