문제

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>
도움이 되었습니까?

해결책

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');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top