Domanda

Is it possible to create a CakePHP link using HtmlHelper without href attribute?

<?php echo $this->Html->link('Enter'); ?>

Will output:

<a href="">Enter</a>

What I want is this:

<a>Enter</a>
È stato utile?

Soluzione

try tag() rather than link()

echo $this->Html->tag('a', 'Enter');

In HtmlHelper link() automatically assigns the href tag

So you can create and king of Html tag by using

$this->Html->tag('Tag Name');
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top